checkly 8.21.0 → 8.22.0
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/ai-context/skills-command/references/configure-playwright-checks.md +2 -1
- package/dist/commands/debug/parse-project.js +2 -0
- package/dist/commands/debug/parse-project.js.map +1 -1
- package/dist/commands/deploy.js +2 -0
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/pw-test.js +2 -0
- package/dist/commands/pw-test.js.map +1 -1
- package/dist/commands/test.js +2 -0
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/validate.js +1 -0
- package/dist/commands/validate.js.map +1 -1
- package/dist/constructs/project.d.ts +1 -0
- package/dist/constructs/project.js +101 -2
- package/dist/constructs/project.js.map +1 -1
- package/dist/constructs/session.d.ts +9 -0
- package/dist/constructs/session.js +25 -0
- package/dist/constructs/session.js.map +1 -1
- package/dist/rest/errors.d.ts +7 -0
- package/dist/rest/errors.js +13 -0
- package/dist/rest/errors.js.map +1 -1
- package/dist/services/check-parser/bundler.d.ts +30 -1
- package/dist/services/check-parser/bundler.js +98 -10
- package/dist/services/check-parser/bundler.js.map +1 -1
- package/dist/services/check-parser/cache-hash.d.ts +36 -3
- package/dist/services/check-parser/cache-hash.js +30 -17
- package/dist/services/check-parser/cache-hash.js.map +1 -1
- package/dist/services/checkly-config-loader.d.ts +34 -1
- package/dist/services/checkly-config-loader.js +37 -0
- package/dist/services/checkly-config-loader.js.map +1 -1
- package/dist/services/config.js +3 -1
- package/dist/services/config.js.map +1 -1
- package/dist/services/embedded-packages/cache.d.ts +48 -0
- package/dist/services/embedded-packages/cache.js +171 -0
- package/dist/services/embedded-packages/cache.js.map +1 -0
- package/dist/services/embedded-packages/integrity.d.ts +28 -0
- package/dist/services/embedded-packages/integrity.js +58 -0
- package/dist/services/embedded-packages/integrity.js.map +1 -0
- package/dist/services/embedded-packages/lockfile-packages.d.ts +48 -0
- package/dist/services/embedded-packages/lockfile-packages.js +227 -0
- package/dist/services/embedded-packages/lockfile-packages.js.map +1 -0
- package/dist/services/embedded-packages/materializer.d.ts +88 -0
- package/dist/services/embedded-packages/materializer.js +314 -0
- package/dist/services/embedded-packages/materializer.js.map +1 -0
- package/dist/services/embedded-packages/npmrc.d.ts +56 -0
- package/dist/services/embedded-packages/npmrc.js +174 -0
- package/dist/services/embedded-packages/npmrc.js.map +1 -0
- package/dist/services/embedded-packages/spec.d.ts +47 -0
- package/dist/services/embedded-packages/spec.js +79 -0
- package/dist/services/embedded-packages/spec.js.map +1 -0
- package/dist/services/playwright-project-bundler.js +17 -0
- package/dist/services/playwright-project-bundler.js.map +1 -1
- package/dist/services/project-parser.d.ts +1 -0
- package/dist/services/project-parser.js +5 -1
- package/dist/services/project-parser.js.map +1 -1
- package/oclif.manifest.json +156 -156
- package/package.json +7 -7
|
@@ -69,6 +69,38 @@ export type ChecklyConfig = {
|
|
|
69
69
|
*/
|
|
70
70
|
playwrightChecks?: PlaywrightSlimmedProp[];
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Code-bundle configuration properties.
|
|
74
|
+
*/
|
|
75
|
+
bundle?: {
|
|
76
|
+
/**
|
|
77
|
+
* Configuration for npm packages shipped inside the code bundle.
|
|
78
|
+
*/
|
|
79
|
+
packages?: {
|
|
80
|
+
/**
|
|
81
|
+
* Dependencies to embed into the code bundle, letting Checkly runners
|
|
82
|
+
* install packages they cannot fetch themselves — e.g. packages from a
|
|
83
|
+
* private registry that is only reachable from your own network.
|
|
84
|
+
* Applies to Playwright Check Suites only.
|
|
85
|
+
*
|
|
86
|
+
* Each entry is a package name (`'@acme/private-utils'`), which embeds
|
|
87
|
+
* every version of that package found in the workspace lockfile, or an
|
|
88
|
+
* exact `name@version` pin (`'legacy-private-pkg@2.1.0'`). Names may
|
|
89
|
+
* contain `*` wildcards (`'@acme/*'`, `'acme-*'`); a wildcard never
|
|
90
|
+
* crosses the `/` scope separator. List every package the runner
|
|
91
|
+
* cannot fetch, including private packages that only appear as
|
|
92
|
+
* transitive dependencies of other private packages — dependencies of
|
|
93
|
+
* listed packages are not embedded automatically.
|
|
94
|
+
*
|
|
95
|
+
* Only npm and pnpm are supported at this time: packages are resolved
|
|
96
|
+
* against the workspace lockfile (`pnpm-lock.yaml` or
|
|
97
|
+
* `package-lock.json`) and always verified against its recorded
|
|
98
|
+
* integrity hashes. Changing the resolved set of embedded packages
|
|
99
|
+
* invalidates the runner's dependency cache.
|
|
100
|
+
*/
|
|
101
|
+
embed?: string[];
|
|
102
|
+
};
|
|
103
|
+
};
|
|
72
104
|
/**
|
|
73
105
|
* Caching-related configuration properties.
|
|
74
106
|
*/
|
|
@@ -81,7 +113,8 @@ export type ChecklyConfig = {
|
|
|
81
113
|
dependencyCache?: {
|
|
82
114
|
/**
|
|
83
115
|
* Optional value mixed into the code bundle's cache hash in addition
|
|
84
|
-
* to its usual inputs (lockfile, package.json and .npmrc files
|
|
116
|
+
* to its usual inputs (lockfile, package.json and .npmrc files, and
|
|
117
|
+
* the resolved `bundle.packages.embed` tarball set).
|
|
85
118
|
* Change the value to force runners to reinstall the bundle's
|
|
86
119
|
* dependencies. Setting it for the first time invalidates the cache
|
|
87
120
|
* once. Numbers must be safe integers; unset and empty string leave
|
|
@@ -3,6 +3,7 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import { findPlaywrightConfigPath, getDefaultChecklyConfig, writeChecklyConfigFile } from './util.js';
|
|
4
4
|
import { Session } from '../constructs/index.js';
|
|
5
5
|
import { normalizeDependencyCacheVersion } from './check-parser/cache-hash.js';
|
|
6
|
+
import { parseEmbeddedPackageSpec } from './embedded-packages/spec.js';
|
|
6
7
|
function isString(obj) {
|
|
7
8
|
return (Object.prototype.toString.call(obj) === '[object String]');
|
|
8
9
|
}
|
|
@@ -82,6 +83,7 @@ export async function loadChecklyConfig(dir, filenames = defaultFilenames, write
|
|
|
82
83
|
}
|
|
83
84
|
validateConfigFields(config, ['logicalId', 'projectName']);
|
|
84
85
|
validateDependencyCacheVersion(config);
|
|
86
|
+
validateBundle(config);
|
|
85
87
|
const constructs = Session.checklyConfigFileConstructs;
|
|
86
88
|
Session.checklyConfigFileConstructs = [];
|
|
87
89
|
if (config.cli?.loader) {
|
|
@@ -120,4 +122,39 @@ function validateDependencyCacheVersion(config) {
|
|
|
120
122
|
throw new Error(`Config field 'caching.dependencyCache.version' must be a string or a safe integer if set`, { cause });
|
|
121
123
|
}
|
|
122
124
|
}
|
|
125
|
+
function validateBundle(config) {
|
|
126
|
+
const { bundle } = config;
|
|
127
|
+
if (bundle === undefined) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// A misshapen `bundle` block would otherwise read as `embed: undefined`
|
|
131
|
+
// and silently disable embedding, surfacing only as an install failure on
|
|
132
|
+
// the runner. Plain-JS configs bypass the TypeScript type, so the shape
|
|
133
|
+
// must be enforced at runtime.
|
|
134
|
+
if (bundle === null || typeof bundle !== 'object' || Array.isArray(bundle)) {
|
|
135
|
+
throw new Error(`Config field 'bundle' must be an object if set`);
|
|
136
|
+
}
|
|
137
|
+
const { packages } = bundle;
|
|
138
|
+
if (packages === undefined) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (packages === null || typeof packages !== 'object' || Array.isArray(packages)) {
|
|
142
|
+
throw new Error(`Config field 'bundle.packages' must be an object if set`);
|
|
143
|
+
}
|
|
144
|
+
const embeddedPackages = packages.embed;
|
|
145
|
+
if (embeddedPackages === undefined) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (!Array.isArray(embeddedPackages)) {
|
|
149
|
+
throw new Error(`Config field 'bundle.packages.embed' must be an array of strings if set`);
|
|
150
|
+
}
|
|
151
|
+
for (const spec of embeddedPackages) {
|
|
152
|
+
try {
|
|
153
|
+
parseEmbeddedPackageSpec(spec);
|
|
154
|
+
}
|
|
155
|
+
catch (cause) {
|
|
156
|
+
throw new Error(`Config field 'bundle.packages.embed' is invalid: ${cause.message}`, { cause });
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
123
160
|
//# sourceMappingURL=checkly-config-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkly-config-loader.js","sourceRoot":"","sources":["../../src/services/checkly-config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAGrG,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAMhD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"checkly-config-loader.js","sourceRoot":"","sources":["../../src/services/checkly-config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAGrG,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAMhD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAA;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAmKtE,SAAS,QAAQ,CAAE,GAAQ;IACzB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,iBAAiB,CAAC,CAAA;AACpE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,SAAS,GAAG;QAChB,mBAAmB;QACnB,oBAAoB;QACpB,oBAAoB;QACpB,mBAAmB;QACnB,oBAAoB;QACpB,oBAAoB;KACrB,CAAA;IACD,IAAI,MAAM,CAAA;IACV,KAAK,MAAM,UAAU,IAAI,SAAS,EAAE,CAA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CAAC;YACf,MAAM,IAAI,KAAK,CAAC,oDAAqD,KAAe,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QAC5G,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/services/config.js
CHANGED
|
@@ -74,7 +74,9 @@ class ChecklyConfig {
|
|
|
74
74
|
}
|
|
75
75
|
getMqttUrl() {
|
|
76
76
|
const environments = {
|
|
77
|
-
local
|
|
77
|
+
// Overridable for local development setups whose event stream is served
|
|
78
|
+
// from a different broker, mirroring how CHECKLY_API_URL overrides the API.
|
|
79
|
+
local: process.env.CHECKLY_MQTT_URL || 'wss://events-local.checklyhq.com',
|
|
78
80
|
development: 'wss://events-dev.checklyhq.com',
|
|
79
81
|
staging: 'wss://events-test.checklyhq.com',
|
|
80
82
|
production: 'wss://events.checklyhq.com',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/services/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,MAAM,UAAU,GAAG;IACjB,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC7B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CAChC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CAC3B,CAAA;AAED,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAA;AAEnD,gDAAgD;AAChD,IAAK,GAKJ;AALD,WAAK,GAAG;IACN,gCAAyB,CAAA;IACzB,0BAAmB,CAAA;IACnB,kCAA2B,CAAA;IAC3B,sBAAe,CAAA;AACjB,CAAC,EALI,GAAG,KAAH,GAAG,QAKP;AAED,MAAM,aAAa;IACT,KAAK,CAA4B;IACjC,KAAK,CAAqD;IAElE,iEAAiE;IACjE,iHAAiH;IACjH,IAAI,IAAI;QACN,2BAA2B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O,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAA;QAChD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAA;QACtD,OAAO,MAAM,KAAK,EAAE,IAAI,SAAS,KAAK,EAAE,CAAA;IAC1C,CAAC;IAED,SAAS;QACP,MAAM,YAAY,GAAG;YACnB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB;YAC7D,WAAW,EAAE,+BAA+B;YAC5C,OAAO,EAAE,gCAAgC;YACzC,UAAU,EAAE,2BAA2B;SACxC,CAAA;QACD,OAAO,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAE,CAAA;IACrC,CAAC;IAED,UAAU;QACR,MAAM,YAAY,GAAG;YACnB,wEAAwE;YACxE,4EAA4E;YAC5E,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,kCAAkC;YACzE,WAAW,EAAE,gCAAgC;YAC7C,OAAO,EAAE,iCAAiC;YAC1C,UAAU,EAAE,4BAA4B;SACzC,CAAA;QACD,OAAO,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAE,CAAA;IACrC,CAAC;IAED,mBAAmB;QACjB,IAAI,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAED,MAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAA;AAClC,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Checkly CLI's cache directories, in precedence order. A
|
|
3
|
+
* `CHECKLY_CACHE_DIR` override is the sole location. Otherwise the primary
|
|
4
|
+
* is the project-local `node_modules/.cache/checkly` (the conventional
|
|
5
|
+
* tool-cache location — incremental installs leave it alone, and CI setups
|
|
6
|
+
* that cache `node_modules` persist it automatically), backed by a
|
|
7
|
+
* per-user platform cache directory (macOS: `~/Library/Caches/checkly`,
|
|
8
|
+
* Windows: `%LOCALAPPDATA%\checkly\Cache`, elsewhere:
|
|
9
|
+
* `$XDG_CACHE_HOME/checkly` or `~/.cache/checkly`) that serves as a read
|
|
10
|
+
* tier and as the write fallback when the project location isn't writable
|
|
11
|
+
* (e.g. a read-only checkout).
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveCacheDirs(env?: NodeJS.ProcessEnv, projectRoot?: string, platform?: NodeJS.Platform, homedir?: string): string[];
|
|
14
|
+
/**
|
|
15
|
+
* A content-addressed store of package tarballs, keyed by the lockfile's
|
|
16
|
+
* integrity hash, spread over one or more root directories in precedence
|
|
17
|
+
* order (typically the project-local cache backed by the per-user one).
|
|
18
|
+
* Reads consult every root and verify the content, so a corrupt entry
|
|
19
|
+
* degrades to a cache miss rather than a user-facing error. Writes go to
|
|
20
|
+
* the first root that accepts them, so an unwritable project tree falls
|
|
21
|
+
* back to the per-user cache instead of failing.
|
|
22
|
+
*/
|
|
23
|
+
export declare class TarballCache {
|
|
24
|
+
#private;
|
|
25
|
+
constructor(rootDirs: string | string[]);
|
|
26
|
+
static default(env?: NodeJS.ProcessEnv, projectRoot?: string, platform?: NodeJS.Platform, homedir?: string): TarballCache;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the path of a cached, integrity-verified tarball, or undefined
|
|
29
|
+
* on a miss. A file that fails verification is deleted best-effort.
|
|
30
|
+
*/
|
|
31
|
+
get(integrity: string): Promise<string | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Stores verified tarball content in the first writable root and returns
|
|
34
|
+
* its path. The write is atomic (temp file + rename), so concurrent
|
|
35
|
+
* processes sharing the cache never observe a torn file. The caller is
|
|
36
|
+
* responsible for verifying the content against the lockfile integrity
|
|
37
|
+
* beforehand.
|
|
38
|
+
*/
|
|
39
|
+
put(integrity: string, content: Buffer): Promise<string>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Looks up a tarball in npm's cache (cacache), which stores raw registry
|
|
43
|
+
* tarballs content-addressed by the same sha512 the lockfile records, at
|
|
44
|
+
* `content-v2/sha512/<hex[0:2]>/<hex[2:4]>/<hex[4:]>`. Returns verified
|
|
45
|
+
* content, or undefined when absent, unverifiable, or keyed by an
|
|
46
|
+
* algorithm other than sha512. Read-only: npm's cache is never written to.
|
|
47
|
+
*/
|
|
48
|
+
export declare function lookupNpmCacache(integrity: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, homedir?: string): Promise<Buffer | undefined>;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import process from 'node:process';
|
|
6
|
+
import Debug from 'debug';
|
|
7
|
+
import { integrityHashToHex, strongestIntegrityHash, verifyIntegrity } from './integrity.js';
|
|
8
|
+
const debug = Debug('checkly:cli:services:embedded-packages');
|
|
9
|
+
function platformCacheDir(env, platform, homedir) {
|
|
10
|
+
switch (platform) {
|
|
11
|
+
case 'darwin':
|
|
12
|
+
return path.join(homedir, 'Library', 'Caches', 'checkly');
|
|
13
|
+
case 'win32': {
|
|
14
|
+
const localAppData = env.LOCALAPPDATA !== undefined && env.LOCALAPPDATA !== ''
|
|
15
|
+
? env.LOCALAPPDATA
|
|
16
|
+
: path.join(homedir, 'AppData', 'Local');
|
|
17
|
+
return path.join(localAppData, 'checkly', 'Cache');
|
|
18
|
+
}
|
|
19
|
+
default: {
|
|
20
|
+
const xdgCacheHome = env.XDG_CACHE_HOME;
|
|
21
|
+
const cacheHome = xdgCacheHome !== undefined && xdgCacheHome !== ''
|
|
22
|
+
? xdgCacheHome
|
|
23
|
+
: path.join(homedir, '.cache');
|
|
24
|
+
return path.join(cacheHome, 'checkly');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The Checkly CLI's cache directories, in precedence order. A
|
|
30
|
+
* `CHECKLY_CACHE_DIR` override is the sole location. Otherwise the primary
|
|
31
|
+
* is the project-local `node_modules/.cache/checkly` (the conventional
|
|
32
|
+
* tool-cache location — incremental installs leave it alone, and CI setups
|
|
33
|
+
* that cache `node_modules` persist it automatically), backed by a
|
|
34
|
+
* per-user platform cache directory (macOS: `~/Library/Caches/checkly`,
|
|
35
|
+
* Windows: `%LOCALAPPDATA%\checkly\Cache`, elsewhere:
|
|
36
|
+
* `$XDG_CACHE_HOME/checkly` or `~/.cache/checkly`) that serves as a read
|
|
37
|
+
* tier and as the write fallback when the project location isn't writable
|
|
38
|
+
* (e.g. a read-only checkout).
|
|
39
|
+
*/
|
|
40
|
+
export function resolveCacheDirs(env = process.env, projectRoot, platform = process.platform, homedir = os.homedir()) {
|
|
41
|
+
const override = env.CHECKLY_CACHE_DIR;
|
|
42
|
+
if (override !== undefined && override !== '') {
|
|
43
|
+
return [path.resolve(override)];
|
|
44
|
+
}
|
|
45
|
+
const dirs = [];
|
|
46
|
+
if (projectRoot !== undefined) {
|
|
47
|
+
dirs.push(path.join(projectRoot, 'node_modules', '.cache', 'checkly'));
|
|
48
|
+
}
|
|
49
|
+
dirs.push(platformCacheDir(env, platform, homedir));
|
|
50
|
+
return [...new Set(dirs)];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A content-addressed store of package tarballs, keyed by the lockfile's
|
|
54
|
+
* integrity hash, spread over one or more root directories in precedence
|
|
55
|
+
* order (typically the project-local cache backed by the per-user one).
|
|
56
|
+
* Reads consult every root and verify the content, so a corrupt entry
|
|
57
|
+
* degrades to a cache miss rather than a user-facing error. Writes go to
|
|
58
|
+
* the first root that accepts them, so an unwritable project tree falls
|
|
59
|
+
* back to the per-user cache instead of failing.
|
|
60
|
+
*/
|
|
61
|
+
export class TarballCache {
|
|
62
|
+
#rootDirs;
|
|
63
|
+
constructor(rootDirs) {
|
|
64
|
+
this.#rootDirs = Array.isArray(rootDirs) ? rootDirs : [rootDirs];
|
|
65
|
+
}
|
|
66
|
+
static default(env = process.env, projectRoot, platform = process.platform, homedir = os.homedir()) {
|
|
67
|
+
return new TarballCache(resolveCacheDirs(env, projectRoot, platform, homedir)
|
|
68
|
+
.map(dir => path.join(dir, 'embedded-packages')));
|
|
69
|
+
}
|
|
70
|
+
#pathFor(rootDir, hash) {
|
|
71
|
+
const hex = integrityHashToHex(hash);
|
|
72
|
+
return path.join(rootDir, hash.algorithm, hex.slice(0, 2), `${hex.slice(2)}.tgz`);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the path of a cached, integrity-verified tarball, or undefined
|
|
76
|
+
* on a miss. A file that fails verification is deleted best-effort.
|
|
77
|
+
*/
|
|
78
|
+
async get(integrity) {
|
|
79
|
+
const hash = strongestIntegrityHash(integrity);
|
|
80
|
+
if (hash === undefined) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
for (const rootDir of this.#rootDirs) {
|
|
84
|
+
const filePath = this.#pathFor(rootDir, hash);
|
|
85
|
+
let content;
|
|
86
|
+
try {
|
|
87
|
+
content = await fs.readFile(filePath);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (!verifyIntegrity(content, integrity)) {
|
|
93
|
+
await fs.rm(filePath, { force: true }).catch(() => { });
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
return filePath;
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Stores verified tarball content in the first writable root and returns
|
|
102
|
+
* its path. The write is atomic (temp file + rename), so concurrent
|
|
103
|
+
* processes sharing the cache never observe a torn file. The caller is
|
|
104
|
+
* responsible for verifying the content against the lockfile integrity
|
|
105
|
+
* beforehand.
|
|
106
|
+
*/
|
|
107
|
+
async put(integrity, content) {
|
|
108
|
+
const hash = strongestIntegrityHash(integrity);
|
|
109
|
+
if (hash === undefined) {
|
|
110
|
+
throw new Error(`Cannot cache a tarball without a supported integrity hash ('${integrity}')`);
|
|
111
|
+
}
|
|
112
|
+
let lastError;
|
|
113
|
+
for (const [index, rootDir] of this.#rootDirs.entries()) {
|
|
114
|
+
const filePath = this.#pathFor(rootDir, hash);
|
|
115
|
+
const tempPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
|
|
116
|
+
try {
|
|
117
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
118
|
+
await fs.writeFile(tempPath, content);
|
|
119
|
+
await fs.rename(tempPath, filePath);
|
|
120
|
+
if (index > 0) {
|
|
121
|
+
debug('cache write fell back to %s', rootDir);
|
|
122
|
+
}
|
|
123
|
+
return filePath;
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
debug('cache root %s is not writable: %s', rootDir, err.message);
|
|
127
|
+
lastError = err;
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
await fs.rm(tempPath, { force: true }).catch(() => { });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
throw new Error(`Unable to write the embedded-packages cache`
|
|
134
|
+
+ ` (tried ${this.#rootDirs.map(dir => `'${dir}'`).join(', ')}).`
|
|
135
|
+
+ ` Set CHECKLY_CACHE_DIR to a writable directory to override the cache location.`, { cause: lastError });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Looks up a tarball in npm's cache (cacache), which stores raw registry
|
|
140
|
+
* tarballs content-addressed by the same sha512 the lockfile records, at
|
|
141
|
+
* `content-v2/sha512/<hex[0:2]>/<hex[2:4]>/<hex[4:]>`. Returns verified
|
|
142
|
+
* content, or undefined when absent, unverifiable, or keyed by an
|
|
143
|
+
* algorithm other than sha512. Read-only: npm's cache is never written to.
|
|
144
|
+
*/
|
|
145
|
+
export async function lookupNpmCacache(integrity, env = process.env, platform = process.platform, homedir = os.homedir()) {
|
|
146
|
+
const hash = strongestIntegrityHash(integrity);
|
|
147
|
+
if (hash === undefined || hash.algorithm !== 'sha512') {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
const npmCacheDir = env.npm_config_cache !== undefined && env.npm_config_cache !== ''
|
|
151
|
+
? env.npm_config_cache
|
|
152
|
+
: platform === 'win32'
|
|
153
|
+
? path.join(env.LOCALAPPDATA !== undefined && env.LOCALAPPDATA !== ''
|
|
154
|
+
? env.LOCALAPPDATA
|
|
155
|
+
: path.join(homedir, 'AppData', 'Local'), 'npm-cache')
|
|
156
|
+
: path.join(homedir, '.npm');
|
|
157
|
+
const hex = integrityHashToHex(hash);
|
|
158
|
+
const contentPath = path.join(npmCacheDir, '_cacache', 'content-v2', 'sha512', hex.slice(0, 2), hex.slice(2, 4), hex.slice(4));
|
|
159
|
+
let content;
|
|
160
|
+
try {
|
|
161
|
+
content = await fs.readFile(contentPath);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
if (!verifyIntegrity(content, integrity)) {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
return content;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/services/embedded-packages/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,OAAO,MAAM,cAAc,CAAA;AAElC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAiB,kBAAkB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE3G,MAAM,KAAK,GAA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,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;QACzC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single parsed SRI (Subresource Integrity) hash, e.g. one
|
|
3
|
+
* `sha512-<base64>` segment of a lockfile `integrity` value.
|
|
4
|
+
*/
|
|
5
|
+
export interface IntegrityHash {
|
|
6
|
+
algorithm: string;
|
|
7
|
+
digestBase64: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Parses an SRI string (one or more space-separated `algorithm-base64`
|
|
11
|
+
* entries) into its supported hashes, unknown algorithms excluded.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseIntegrity(integrity: string): IntegrityHash[];
|
|
14
|
+
/**
|
|
15
|
+
* Returns the strongest supported hash of an SRI string, or undefined if
|
|
16
|
+
* none of its entries use a supported algorithm.
|
|
17
|
+
*/
|
|
18
|
+
export declare function strongestIntegrityHash(integrity: string): IntegrityHash | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Verifies content against an SRI string using its strongest supported
|
|
21
|
+
* hash. Returns false when no supported hash is present.
|
|
22
|
+
*/
|
|
23
|
+
export declare function verifyIntegrity(content: Buffer, integrity: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The hex encoding of an SRI hash's digest. npm's cacache stores content
|
|
26
|
+
* under this encoding, e.g. `content-v2/sha512/<hex[0:2]>/<hex[2:4]>/<hex[4:]>`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function integrityHashToHex(hash: IntegrityHash): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
// Ordered strongest first. Lockfiles produced in the last decade only use
|
|
3
|
+
// sha512 and (for very old entries) sha1, but sha384/sha256 are valid SRI.
|
|
4
|
+
const SUPPORTED_ALGORITHMS = ['sha512', 'sha384', 'sha256', 'sha1'];
|
|
5
|
+
/**
|
|
6
|
+
* Parses an SRI string (one or more space-separated `algorithm-base64`
|
|
7
|
+
* entries) into its supported hashes, unknown algorithms excluded.
|
|
8
|
+
*/
|
|
9
|
+
export function parseIntegrity(integrity) {
|
|
10
|
+
const hashes = [];
|
|
11
|
+
for (const entry of integrity.trim().split(/\s+/)) {
|
|
12
|
+
const separator = entry.indexOf('-');
|
|
13
|
+
if (separator === -1) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const algorithm = entry.slice(0, separator);
|
|
17
|
+
const digestBase64 = entry.slice(separator + 1);
|
|
18
|
+
if (!SUPPORTED_ALGORITHMS.includes(algorithm) || digestBase64 === '') {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
hashes.push({ algorithm, digestBase64 });
|
|
22
|
+
}
|
|
23
|
+
return hashes;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the strongest supported hash of an SRI string, or undefined if
|
|
27
|
+
* none of its entries use a supported algorithm.
|
|
28
|
+
*/
|
|
29
|
+
export function strongestIntegrityHash(integrity) {
|
|
30
|
+
const hashes = parseIntegrity(integrity);
|
|
31
|
+
for (const algorithm of SUPPORTED_ALGORITHMS) {
|
|
32
|
+
const match = hashes.find(hash => hash.algorithm === algorithm);
|
|
33
|
+
if (match !== undefined) {
|
|
34
|
+
return match;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Verifies content against an SRI string using its strongest supported
|
|
41
|
+
* hash. Returns false when no supported hash is present.
|
|
42
|
+
*/
|
|
43
|
+
export function verifyIntegrity(content, integrity) {
|
|
44
|
+
const hash = strongestIntegrityHash(integrity);
|
|
45
|
+
if (hash === undefined) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const digest = createHash(hash.algorithm).update(content).digest('base64');
|
|
49
|
+
return digest === hash.digestBase64;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The hex encoding of an SRI hash's digest. npm's cacache stores content
|
|
53
|
+
* under this encoding, e.g. `content-v2/sha512/<hex[0:2]>/<hex[2:4]>/<hex[4:]>`.
|
|
54
|
+
*/
|
|
55
|
+
export function integrityHashToHex(hash) {
|
|
56
|
+
return Buffer.from(hash.digestBase64, 'base64').toString('hex');
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=integrity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrity.js","sourceRoot":"","sources":["../../../src/services/embedded-packages/integrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAWxC,0EAA0E;AAC1E,2EAA2E;AAC3E,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;AAEnE;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAE,SAAiB;IAC/C,MAAM,MAAM,GAAoB,EAAE,CAAA;IAElC,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACpC,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;YACrB,SAAQ;QACV,CAAC;QACD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;QAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA;QAC/C,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,YAAY,KAAK,EAAE,EAAE,CAAC;YACrE,SAAQ;QACV,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAA;IAC1C,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAE,SAAiB;IACvD,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CAAA;IACxC,KAAK,MAAM,SAAS,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAA;QAC/D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAE,OAAe,EAAE,SAAiB;IACjE,MAAM,IAAI,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAA;IAC9C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC1E,OAAO,MAAM,KAAK,IAAI,CAAC,YAAY,CAAA;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAE,IAAmB;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AACjE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One embeddable `name@version` entry from the lockfile: a package that a
|
|
3
|
+
* registry serves as a tarball, with the integrity hash recorded for it.
|
|
4
|
+
*/
|
|
5
|
+
export interface LockfileRegistryPackage {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
integrity: string;
|
|
9
|
+
/**
|
|
10
|
+
* The full tarball URL when the lockfile records one (npm's `resolved`,
|
|
11
|
+
* pnpm's `resolution.tarball`). When absent, the URL is derived from the
|
|
12
|
+
* registry configuration.
|
|
13
|
+
*/
|
|
14
|
+
tarballUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A lockfile entry that cannot be embedded as a registry tarball, kept so
|
|
18
|
+
* that a configured spec matching only such entries gets a precise error
|
|
19
|
+
* instead of a generic "not found in the lockfile".
|
|
20
|
+
*/
|
|
21
|
+
export interface ExcludedLockfilePackage {
|
|
22
|
+
name: string;
|
|
23
|
+
version?: string;
|
|
24
|
+
reason: string;
|
|
25
|
+
/**
|
|
26
|
+
* Why the entry is excluded, machine-readable: 'workspace' entries are
|
|
27
|
+
* part of the project itself (safe for a wildcard to skip silently),
|
|
28
|
+
* while 'unfetchable' entries (git/file/URL dependencies, or entries
|
|
29
|
+
* without an integrity hash) cannot be embedded but may still be needed
|
|
30
|
+
* at install time.
|
|
31
|
+
*/
|
|
32
|
+
kind: 'workspace' | 'unfetchable';
|
|
33
|
+
}
|
|
34
|
+
export interface LockfilePackages {
|
|
35
|
+
registry: LockfileRegistryPackage[];
|
|
36
|
+
excluded: ExcludedLockfilePackage[];
|
|
37
|
+
}
|
|
38
|
+
export declare class UnsupportedLockfileError extends Error {
|
|
39
|
+
constructor(message: string);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Enumerates every package entry in a lockfile, classified into embeddable
|
|
43
|
+
* registry packages and excluded (git/file/link/integrity-less) entries.
|
|
44
|
+
* Supports `pnpm-lock.yaml` (v6/v9) and `package-lock.json` (v2/v3).
|
|
45
|
+
*/
|
|
46
|
+
export declare function loadLockfilePackages(lockfilePath: string): Promise<LockfilePackages>;
|
|
47
|
+
export declare function parsePnpmLockfilePackages(content: string): LockfilePackages;
|
|
48
|
+
export declare function parseNpmLockfilePackages(content: string): LockfilePackages;
|