checkly 4.16.0 → 4.17.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/commands/baseCommand.d.ts +1 -0
- package/dist/commands/baseCommand.js +7 -0
- package/dist/commands/baseCommand.js.map +1 -1
- package/dist/commands/deploy.js +6 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/sync-playwright.js +9 -3
- package/dist/commands/sync-playwright.js.map +1 -1
- package/dist/commands/test.js +6 -2
- package/dist/commands/test.js.map +1 -1
- package/dist/constructs/api-check.js +1 -5
- package/dist/constructs/api-check.js.map +1 -1
- package/dist/constructs/browser-check.js +1 -5
- package/dist/constructs/browser-check.js.map +1 -1
- package/dist/constructs/multi-step-check.js +1 -5
- package/dist/constructs/multi-step-check.js.map +1 -1
- package/dist/constructs/project.d.ts +3 -0
- package/dist/constructs/project.js +14 -0
- package/dist/constructs/project.js.map +1 -1
- package/dist/services/check-parser/package-files/extension.d.ts +28 -0
- package/dist/services/check-parser/package-files/extension.js +56 -0
- package/dist/services/check-parser/package-files/extension.js.map +1 -0
- package/dist/services/check-parser/package-files/jsconfig-json-file.d.ts +17 -0
- package/dist/services/check-parser/package-files/jsconfig-json-file.js +46 -0
- package/dist/services/check-parser/package-files/jsconfig-json-file.js.map +1 -0
- package/dist/services/check-parser/package-files/json-source-file.d.ts +10 -0
- package/dist/services/check-parser/package-files/json-source-file.js +38 -0
- package/dist/services/check-parser/package-files/json-source-file.js.map +1 -0
- package/dist/services/check-parser/package-files/loader.d.ts +7 -0
- package/dist/services/check-parser/package-files/loader.js +19 -0
- package/dist/services/check-parser/package-files/loader.js.map +1 -0
- package/dist/services/check-parser/package-files/lookup.d.ts +12 -0
- package/dist/services/check-parser/package-files/lookup.js +70 -0
- package/dist/services/check-parser/package-files/lookup.js.map +1 -0
- package/dist/services/check-parser/package-files/package-json-file.d.ts +19 -0
- package/dist/services/check-parser/package-files/package-json-file.js +45 -0
- package/dist/services/check-parser/package-files/package-json-file.js.map +1 -0
- package/dist/services/check-parser/package-files/paths.d.ts +80 -0
- package/dist/services/check-parser/package-files/paths.js +164 -0
- package/dist/services/check-parser/package-files/paths.js.map +1 -0
- package/dist/services/check-parser/package-files/resolver.d.ts +66 -0
- package/dist/services/check-parser/package-files/resolver.js +277 -0
- package/dist/services/check-parser/package-files/resolver.js.map +1 -0
- package/dist/services/check-parser/package-files/source-file.d.ts +15 -0
- package/dist/services/check-parser/package-files/source-file.js +54 -0
- package/dist/services/check-parser/package-files/source-file.js.map +1 -0
- package/dist/services/check-parser/package-files/tsconfig-json-file.d.ts +66 -0
- package/dist/services/check-parser/package-files/tsconfig-json-file.js +95 -0
- package/dist/services/check-parser/package-files/tsconfig-json-file.js.map +1 -0
- package/dist/services/check-parser/parser.d.ts +12 -16
- package/dist/services/check-parser/parser.js +75 -96
- package/dist/services/check-parser/parser.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SourceFile } from './source-file';
|
|
2
|
+
export declare class JsonSourceFile<Schema> {
|
|
3
|
+
#private;
|
|
4
|
+
readonly id: number;
|
|
5
|
+
sourceFile: SourceFile;
|
|
6
|
+
data: Schema;
|
|
7
|
+
private constructor();
|
|
8
|
+
get meta(): import("./source-file").FileMeta;
|
|
9
|
+
static loadFromSourceFile<Schema>(sourceFile: SourceFile): JsonSourceFile<Schema> | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
+
};
|
|
13
|
+
var _a, _JsonSourceFile_id;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.JsonSourceFile = void 0;
|
|
16
|
+
class JsonSourceFile {
|
|
17
|
+
constructor(sourceFile, data) {
|
|
18
|
+
var _b, _c;
|
|
19
|
+
this.id = __classPrivateFieldSet(_b = _a, _a, (_c = __classPrivateFieldGet(_b, _a, "f", _JsonSourceFile_id), ++_c), "f", _JsonSourceFile_id);
|
|
20
|
+
this.sourceFile = sourceFile;
|
|
21
|
+
this.data = data;
|
|
22
|
+
}
|
|
23
|
+
get meta() {
|
|
24
|
+
return this.sourceFile.meta;
|
|
25
|
+
}
|
|
26
|
+
static loadFromSourceFile(sourceFile) {
|
|
27
|
+
try {
|
|
28
|
+
const data = JSON.parse(sourceFile.contents);
|
|
29
|
+
return new _a(sourceFile, data);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.JsonSourceFile = JsonSourceFile;
|
|
36
|
+
_a = JsonSourceFile;
|
|
37
|
+
_JsonSourceFile_id = { value: 0 };
|
|
38
|
+
//# sourceMappingURL=json-source-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-source-file.js","sourceRoot":"","sources":["../../../../src/services/check-parser/package-files/json-source-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,MAAa,cAAc;IAOzB,YAAqB,UAAsB,EAAE,IAAY;;QALhD,OAAE,GAAG,oCAAA,CAAE,4DAAkB,EAApB,IAAoB,CAAA,0BAAA,CAAA;QAMhC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAA;IAC7B,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAU,UAAsB;QACvD,IAAI,CAAC;YACH,MAAM,IAAI,GAAW,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;YAEpD,OAAO,IAAI,EAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QAC7C,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;;AAvBH,wCAwBC;;AAvBQ,8BAAM,CAAC,EAAJ,CAAI"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileLoader = void 0;
|
|
4
|
+
class FileLoader {
|
|
5
|
+
constructor(loader) {
|
|
6
|
+
this.cache = new Map();
|
|
7
|
+
this.loader = loader;
|
|
8
|
+
}
|
|
9
|
+
load(filePath) {
|
|
10
|
+
if (this.cache.has(filePath)) {
|
|
11
|
+
return this.cache.get(filePath);
|
|
12
|
+
}
|
|
13
|
+
const file = this.loader(filePath);
|
|
14
|
+
this.cache.set(filePath, file);
|
|
15
|
+
return file;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.FileLoader = FileLoader;
|
|
19
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../../src/services/check-parser/package-files/loader.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IAIrB,YAAa,MAAmB;QAFhC,UAAK,GAAG,IAAI,GAAG,EAAyB,CAAA;QAGtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,IAAI,CAAE,QAAgB;QACpB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACjC,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAClC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAhBD,gCAgBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Options = {
|
|
2
|
+
plainJs?: boolean;
|
|
3
|
+
};
|
|
4
|
+
export declare class LookupContext {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(options: Options);
|
|
7
|
+
static forFilePath(filePath: string): LookupContext;
|
|
8
|
+
collectLookupPaths(filePath: string): string[];
|
|
9
|
+
private extlessCoreLookupPaths;
|
|
10
|
+
private extlessTSLookupPaths;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _LookupContext_plainJs;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LookupContext = void 0;
|
|
16
|
+
const package_json_file_1 = require("./package-json-file");
|
|
17
|
+
const extension_1 = require("./extension");
|
|
18
|
+
class LookupContext {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
var _a;
|
|
21
|
+
_LookupContext_plainJs.set(this, void 0);
|
|
22
|
+
__classPrivateFieldSet(this, _LookupContext_plainJs, (_a = options.plainJs) !== null && _a !== void 0 ? _a : false, "f");
|
|
23
|
+
}
|
|
24
|
+
static forFilePath(filePath) {
|
|
25
|
+
return new LookupContext({
|
|
26
|
+
plainJs: extension_1.FileExtPath.fromFilePath(filePath).hasCoreExtension(),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
collectLookupPaths(filePath) {
|
|
30
|
+
const extPath = extension_1.FileExtPath.fromFilePath(filePath);
|
|
31
|
+
if (__classPrivateFieldGet(this, _LookupContext_plainJs, "f")) {
|
|
32
|
+
if (extPath.hasCoreExtension()) {
|
|
33
|
+
return [extPath.self()];
|
|
34
|
+
}
|
|
35
|
+
return this.extlessCoreLookupPaths(extPath);
|
|
36
|
+
}
|
|
37
|
+
if (extPath.hasCoreExtension()) {
|
|
38
|
+
const extensions = extension_1.tsCoreExtensionLookupOrder[extPath.ext];
|
|
39
|
+
return extensions.map(ext => extPath.replaceExt(ext));
|
|
40
|
+
}
|
|
41
|
+
if (extPath.hasTypeScriptExtension()) {
|
|
42
|
+
const extensions = extension_1.tsExtensionLookupOrder[extPath.ext];
|
|
43
|
+
return extensions.map(ext => extPath.replaceExt(ext));
|
|
44
|
+
}
|
|
45
|
+
return this.extlessTSLookupPaths(extPath);
|
|
46
|
+
}
|
|
47
|
+
extlessCoreLookupPaths(extPath) {
|
|
48
|
+
return [
|
|
49
|
+
extPath.appendExt('.js'),
|
|
50
|
+
extPath.appendExt('.mjs'),
|
|
51
|
+
extPath.appendExt('.cjs'),
|
|
52
|
+
extPath.appendExt('.json'),
|
|
53
|
+
extPath.resolve(package_json_file_1.PackageJsonFile.FILENAME),
|
|
54
|
+
extPath.resolve('index.js'),
|
|
55
|
+
extPath.resolve('index.mjs'),
|
|
56
|
+
extPath.resolve('index.cjs'),
|
|
57
|
+
extPath.resolve('index.json'), // Yes, this works.
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
extlessTSLookupPaths(extPath) {
|
|
61
|
+
return this.extlessCoreLookupPaths(extPath).flatMap(filePath => {
|
|
62
|
+
const extPath = extension_1.FileExtPath.fromFilePath(filePath);
|
|
63
|
+
const extensions = extension_1.tsCoreExtensionLookupOrder[extPath.ext];
|
|
64
|
+
return extensions.map(ext => extPath.replaceExt(ext));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.LookupContext = LookupContext;
|
|
69
|
+
_LookupContext_plainJs = new WeakMap();
|
|
70
|
+
//# sourceMappingURL=lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../../../src/services/check-parser/package-files/lookup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2DAAqD;AACrD,2CAAyH;AAMzH,MAAa,aAAa;IAGxB,YAAa,OAAgB;;QAF7B,yCAAiB;QAGf,uBAAA,IAAI,0BAAY,MAAA,OAAO,CAAC,OAAO,mCAAI,KAAK,MAAA,CAAA;IAC1C,CAAC;IAED,MAAM,CAAC,WAAW,CAAE,QAAgB;QAClC,OAAO,IAAI,aA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,mCAAe,CAAC,QAAQ,CAAC;YACzC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;YAC3B,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;YAC5B,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;YAC5B,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,mBAAmB;SACnD,CAAA;IACH,CAAC;IAEO,oBAAoB,CAAE,OAAoB;QAChD,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC7D,MAAM,OAAO,GAAG,uBAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;YAClD,MAAM,UAAU,GAAG,sCAA0B,CAAC,OAAO,CAAC,GAAoB,CAAC,CAAA;YAC3E,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QACvD,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1DD,sCA0DC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JsonSourceFile } from './json-source-file';
|
|
2
|
+
type ExportCondition = 'node-addons' | 'node' | 'import' | 'require' | 'module-sync' | 'default';
|
|
3
|
+
type Schema = {
|
|
4
|
+
main?: string;
|
|
5
|
+
exports?: string | string[] | Record<string, string> | Record<ExportCondition, Record<string, string>>;
|
|
6
|
+
};
|
|
7
|
+
export declare class PackageJsonFile {
|
|
8
|
+
#private;
|
|
9
|
+
static FILENAME: string;
|
|
10
|
+
readonly id: number;
|
|
11
|
+
jsonFile: JsonSourceFile<Schema>;
|
|
12
|
+
basePath: string;
|
|
13
|
+
mainPaths: string[];
|
|
14
|
+
private constructor();
|
|
15
|
+
get meta(): import("./source-file").FileMeta;
|
|
16
|
+
static loadFromJsonSourceFile(jsonFile: JsonSourceFile<Schema>): PackageJsonFile | undefined;
|
|
17
|
+
static filePath(dirPath: string): string;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
var _a, _PackageJsonFile_id;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PackageJsonFile = void 0;
|
|
19
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
20
|
+
class PackageJsonFile {
|
|
21
|
+
constructor(jsonFile) {
|
|
22
|
+
var _b, _c;
|
|
23
|
+
this.id = __classPrivateFieldSet(_b = _a, _a, (_c = __classPrivateFieldGet(_b, _a, "f", _PackageJsonFile_id), ++_c), "f", _PackageJsonFile_id);
|
|
24
|
+
this.jsonFile = jsonFile;
|
|
25
|
+
this.basePath = jsonFile.meta.dirname;
|
|
26
|
+
const fallbackMainPath = node_path_1.default.resolve(this.basePath, 'index.js');
|
|
27
|
+
this.mainPaths = jsonFile.data.main !== undefined
|
|
28
|
+
? [node_path_1.default.resolve(this.basePath, jsonFile.data.main), fallbackMainPath]
|
|
29
|
+
: [fallbackMainPath];
|
|
30
|
+
}
|
|
31
|
+
get meta() {
|
|
32
|
+
return this.jsonFile.meta;
|
|
33
|
+
}
|
|
34
|
+
static loadFromJsonSourceFile(jsonFile) {
|
|
35
|
+
return new _a(jsonFile);
|
|
36
|
+
}
|
|
37
|
+
static filePath(dirPath) {
|
|
38
|
+
return node_path_1.default.join(dirPath, _a.FILENAME);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.PackageJsonFile = PackageJsonFile;
|
|
42
|
+
_a = PackageJsonFile;
|
|
43
|
+
PackageJsonFile.FILENAME = 'package.json';
|
|
44
|
+
_PackageJsonFile_id = { value: 0 };
|
|
45
|
+
//# sourceMappingURL=package-json-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-json-file.js","sourceRoot":"","sources":["../../../../src/services/check-parser/package-files/package-json-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0DAA4B;AAY5B,MAAa,eAAe;IAU1B,YAAqB,QAAgC;;QAN5C,OAAE,GAAG,oCAAA,CAAE,6DAAmB,EAArB,IAAqB,CAAA,2BAAA,CAAA;QAOjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;QAErC,MAAM,gBAAgB,GAAG,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;QAEhE,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS;YAC/C,CAAC,CAAC,CAAC,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;YACrE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAA;IACxB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAA;IAC3B,CAAC;IAED,MAAM,CAAC,sBAAsB,CAAE,QAAgC;QAC7D,OAAO,IAAI,EAAe,CAAC,QAAQ,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAE,OAAe;QAC9B,OAAO,mBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAe,CAAC,QAAQ,CAAC,CAAA;IACrD,CAAC;;AA/BH,0CAgCC;;AA/BQ,wBAAQ,GAAG,cAAc,AAAjB,CAAiB;AAEzB,+BAAM,CAAC,EAAJ,CAAI"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
type Paths = Record<string, Array<string>>;
|
|
2
|
+
declare class TargetPathSpec {
|
|
3
|
+
/**
|
|
4
|
+
* Prefix is the part of the path before an asterisk (wildcard), or the
|
|
5
|
+
* whole path if there's no asterisk.
|
|
6
|
+
*
|
|
7
|
+
* Examples of possible values:
|
|
8
|
+
* - `"./foo/*"` (from `"./foo/"`)
|
|
9
|
+
* - `"./bar/foo-"` (from `"./bar/foo-*.js"`)
|
|
10
|
+
* - `"./bar."` (from `"./bar.*.ts"`)
|
|
11
|
+
* - `""` (from `"*"`)
|
|
12
|
+
*/
|
|
13
|
+
prefix: string;
|
|
14
|
+
/**
|
|
15
|
+
* Suffix is the part of the path after the asterisk (wildcard), if any.
|
|
16
|
+
*/
|
|
17
|
+
suffix?: string;
|
|
18
|
+
protected constructor(prefix: string, suffix?: string);
|
|
19
|
+
toPath(joker?: string): string;
|
|
20
|
+
static create(spec: string): TargetPathSpec;
|
|
21
|
+
}
|
|
22
|
+
export type TargetPathResult = {
|
|
23
|
+
spec: TargetPathSpec;
|
|
24
|
+
path: string;
|
|
25
|
+
};
|
|
26
|
+
declare class PathMatchResult {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
results: TargetPathResult[];
|
|
29
|
+
private constructor();
|
|
30
|
+
static some(results: TargetPathResult[]): PathMatchResult;
|
|
31
|
+
static none(): PathMatchResult;
|
|
32
|
+
}
|
|
33
|
+
interface PathMatcher {
|
|
34
|
+
get prefixLength(): number;
|
|
35
|
+
match(importPath: string): PathMatchResult;
|
|
36
|
+
}
|
|
37
|
+
declare class SourcePathSpec {
|
|
38
|
+
/**
|
|
39
|
+
* Prefix is the part of the path before an asterisk (wildcard), or the
|
|
40
|
+
* whole path if there's no asterisk.
|
|
41
|
+
*
|
|
42
|
+
* Examples of possible values:
|
|
43
|
+
* - `"@/"` (from `"@/*"`)
|
|
44
|
+
* - `"app/foo-"` (from `"app/foo-*.js"`)
|
|
45
|
+
* - `"bar."` (from `"bar.*.ts"`)
|
|
46
|
+
* - `""` (from `"*"`)
|
|
47
|
+
*/
|
|
48
|
+
prefix: string;
|
|
49
|
+
/**
|
|
50
|
+
* Suffix is the part of the path after the asterisk (wildcard), if any.
|
|
51
|
+
*/
|
|
52
|
+
suffix?: string;
|
|
53
|
+
protected constructor(prefix: string, suffix?: string);
|
|
54
|
+
matcherForTarget(target: TargetPathSpec[]): PathMatcher;
|
|
55
|
+
static create(spec: string): SourcePathSpec;
|
|
56
|
+
}
|
|
57
|
+
type SourcePathSpecMatcher = {
|
|
58
|
+
spec: SourcePathSpec;
|
|
59
|
+
matcher: PathMatcher;
|
|
60
|
+
};
|
|
61
|
+
export type SourcePathResult = {
|
|
62
|
+
spec: SourcePathSpec;
|
|
63
|
+
path: string;
|
|
64
|
+
};
|
|
65
|
+
export type PathResult = {
|
|
66
|
+
source: SourcePathResult;
|
|
67
|
+
target: TargetPathResult;
|
|
68
|
+
};
|
|
69
|
+
export type ResolveResult = PathResult[];
|
|
70
|
+
export declare class PathResolver {
|
|
71
|
+
baseUrl: string;
|
|
72
|
+
matchers: SourcePathSpecMatcher[];
|
|
73
|
+
private constructor();
|
|
74
|
+
resolve(importPath: string): ResolveResult;
|
|
75
|
+
static createFromPaths(baseUrl: string, paths: Paths): PathResolver;
|
|
76
|
+
private static matcherForPath;
|
|
77
|
+
}
|
|
78
|
+
export declare function isLocalPath(importPath: string): boolean;
|
|
79
|
+
export declare function isBuiltinPath(importPath: string): boolean;
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBuiltinPath = exports.isLocalPath = exports.PathResolver = void 0;
|
|
4
|
+
class TargetPathSpec {
|
|
5
|
+
constructor(prefix, suffix) {
|
|
6
|
+
this.prefix = prefix;
|
|
7
|
+
this.suffix = suffix;
|
|
8
|
+
}
|
|
9
|
+
toPath(joker) {
|
|
10
|
+
if (this.suffix === undefined) {
|
|
11
|
+
return this.prefix;
|
|
12
|
+
}
|
|
13
|
+
if (joker === undefined) {
|
|
14
|
+
return this.prefix + this.suffix;
|
|
15
|
+
}
|
|
16
|
+
return this.prefix + joker + this.suffix;
|
|
17
|
+
}
|
|
18
|
+
static create(spec) {
|
|
19
|
+
const parts = spec.split('*', 2);
|
|
20
|
+
if (parts.length === 1) {
|
|
21
|
+
return new TargetPathSpec(spec);
|
|
22
|
+
}
|
|
23
|
+
const [prefix, suffix] = parts;
|
|
24
|
+
return new TargetPathSpec(prefix, suffix);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class PathMatchResult {
|
|
28
|
+
constructor(ok, results) {
|
|
29
|
+
this.ok = ok;
|
|
30
|
+
this.results = results;
|
|
31
|
+
}
|
|
32
|
+
static some(results) {
|
|
33
|
+
return new PathMatchResult(true, results);
|
|
34
|
+
}
|
|
35
|
+
static none() {
|
|
36
|
+
return new PathMatchResult(false, []);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class ExactPathMatcher {
|
|
40
|
+
constructor(prefix, target) {
|
|
41
|
+
this.prefix = prefix;
|
|
42
|
+
this.target = target;
|
|
43
|
+
}
|
|
44
|
+
get prefixLength() {
|
|
45
|
+
return this.prefix.length;
|
|
46
|
+
}
|
|
47
|
+
match(importPath) {
|
|
48
|
+
if (importPath === this.prefix) {
|
|
49
|
+
return PathMatchResult.some(this.target.map(target => {
|
|
50
|
+
return {
|
|
51
|
+
spec: target,
|
|
52
|
+
path: target.toPath(),
|
|
53
|
+
};
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
return PathMatchResult.none();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
class WildcardPathMatcher {
|
|
60
|
+
constructor(prefix, suffix, target) {
|
|
61
|
+
this.prefix = prefix;
|
|
62
|
+
this.suffix = suffix;
|
|
63
|
+
this.target = target;
|
|
64
|
+
}
|
|
65
|
+
get prefixLength() {
|
|
66
|
+
return this.prefix.length;
|
|
67
|
+
}
|
|
68
|
+
match(importPath) {
|
|
69
|
+
if (importPath.startsWith(this.prefix) && importPath.endsWith(this.suffix)) {
|
|
70
|
+
const joker = importPath.substring(this.prefix.length, importPath.length - this.suffix.length);
|
|
71
|
+
return PathMatchResult.some(this.target.map(target => {
|
|
72
|
+
return {
|
|
73
|
+
spec: target,
|
|
74
|
+
path: target.toPath(joker),
|
|
75
|
+
};
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
return PathMatchResult.none();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
class SourcePathSpec {
|
|
82
|
+
constructor(prefix, suffix) {
|
|
83
|
+
this.prefix = prefix;
|
|
84
|
+
this.suffix = suffix;
|
|
85
|
+
}
|
|
86
|
+
matcherForTarget(target) {
|
|
87
|
+
if (this.suffix === undefined) {
|
|
88
|
+
return new ExactPathMatcher(this.prefix, target);
|
|
89
|
+
}
|
|
90
|
+
return new WildcardPathMatcher(this.prefix, this.suffix, target);
|
|
91
|
+
}
|
|
92
|
+
static create(spec) {
|
|
93
|
+
const parts = spec.split('*', 2);
|
|
94
|
+
if (parts.length === 1) {
|
|
95
|
+
return new SourcePathSpec(spec);
|
|
96
|
+
}
|
|
97
|
+
const [prefix, suffix] = parts;
|
|
98
|
+
return new SourcePathSpec(prefix, suffix);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
class PathResolver {
|
|
102
|
+
constructor(baseUrl, matchers) {
|
|
103
|
+
this.baseUrl = baseUrl;
|
|
104
|
+
// Sort by longest prefix now, then we don't have to care about it later.
|
|
105
|
+
matchers.sort((a, b) => b.matcher.prefixLength - a.matcher.prefixLength);
|
|
106
|
+
this.matchers = matchers;
|
|
107
|
+
}
|
|
108
|
+
resolve(importPath) {
|
|
109
|
+
for (const { spec, matcher } of this.matchers) {
|
|
110
|
+
const match = matcher.match(importPath);
|
|
111
|
+
if (match.ok) {
|
|
112
|
+
// We can just return the first match since matchers are already
|
|
113
|
+
// sorted by longest prefix.
|
|
114
|
+
return match.results.map(result => {
|
|
115
|
+
return {
|
|
116
|
+
source: {
|
|
117
|
+
spec,
|
|
118
|
+
path: importPath,
|
|
119
|
+
},
|
|
120
|
+
target: result,
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
static createFromPaths(baseUrl, paths) {
|
|
128
|
+
const matchers = [];
|
|
129
|
+
for (const path in paths) {
|
|
130
|
+
matchers.push(PathResolver.matcherForPath(path, paths[path]));
|
|
131
|
+
}
|
|
132
|
+
return new PathResolver(baseUrl, matchers);
|
|
133
|
+
}
|
|
134
|
+
static matcherForPath(spec, target) {
|
|
135
|
+
const pathSpec = SourcePathSpec.create(spec);
|
|
136
|
+
const matcher = pathSpec.matcherForTarget(target.map(TargetPathSpec.create));
|
|
137
|
+
return {
|
|
138
|
+
spec: pathSpec,
|
|
139
|
+
matcher,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.PathResolver = PathResolver;
|
|
144
|
+
function isLocalPath(importPath) {
|
|
145
|
+
if (importPath.startsWith('/')) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
if (importPath.startsWith('./')) {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
if (importPath.startsWith('../')) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
exports.isLocalPath = isLocalPath;
|
|
157
|
+
function isBuiltinPath(importPath) {
|
|
158
|
+
if (importPath.startsWith('node:')) {
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
exports.isBuiltinPath = isBuiltinPath;
|
|
164
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../src/services/check-parser/package-files/paths.ts"],"names":[],"mappings":";;;AAIA,MAAM,cAAc;IAkBlB,YAAuB,MAAc,EAAE,MAAe;QACpD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,MAAM,CAAE,KAAc;QACpB,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAA;QACpB,CAAC;QAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAClC,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;IAC1C,CAAC;IAED,MAAM,CAAC,MAAM,CAAE,IAAY;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QAChC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;QACjC,CAAC;QACD,MA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K,EAAE,CAAC;YACzB,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAC/D,CAAC;QAED,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC5C,CAAC;IAEO,MAAM,CAAC,cAAc,CAAE,IAAY,EAAE,MAAgB;QAC3D,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;QAE5E,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,OAAO;SACR,CAAA;IACH,CAAC;CACF;AArDD,oCAqDC;AAED,SAAgB,WAAW,CAAE,UAAkB;IAC7C,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAdD,kCAcC;AAED,SAAgB,aAAa,CAAE,UAAkB;IAC/C,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAND,sCAMC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SourceFile } from './source-file';
|
|
2
|
+
import { PackageJsonFile } from './package-json-file';
|
|
3
|
+
import { TSConfigFile } from './tsconfig-json-file';
|
|
4
|
+
import { JSConfigFile } from './jsconfig-json-file';
|
|
5
|
+
import { PathResult } from './paths';
|
|
6
|
+
import { LookupContext } from './lookup';
|
|
7
|
+
declare class PackageFilesCache {
|
|
8
|
+
#private;
|
|
9
|
+
sourceFile(filePath: string, context: LookupContext): SourceFile | undefined;
|
|
10
|
+
packageJson(filePath: string): PackageJsonFile | undefined;
|
|
11
|
+
tsconfigJson(filePath: string): TSConfigFile | undefined;
|
|
12
|
+
jsconfigJson(filePath: string): JSConfigFile | undefined;
|
|
13
|
+
}
|
|
14
|
+
declare class PackageFiles {
|
|
15
|
+
packageJson?: PackageJsonFile;
|
|
16
|
+
tsconfigJson?: TSConfigFile;
|
|
17
|
+
jsconfigJson?: JSConfigFile;
|
|
18
|
+
satisfyFromDirPath(dirPath: string, cache: PackageFilesCache): boolean;
|
|
19
|
+
get satisfied(): boolean;
|
|
20
|
+
}
|
|
21
|
+
type TSConfigFileLocalDependency = {
|
|
22
|
+
kind: 'tsconfig-file';
|
|
23
|
+
importPath: string;
|
|
24
|
+
sourceFile: SourceFile;
|
|
25
|
+
configFile: TSConfigFile;
|
|
26
|
+
};
|
|
27
|
+
type TSConfigResolvedPathLocalDependency = {
|
|
28
|
+
kind: 'tsconfig-resolved-path';
|
|
29
|
+
importPath: string;
|
|
30
|
+
sourceFile: SourceFile;
|
|
31
|
+
configFile: TSConfigFile;
|
|
32
|
+
pathResult: PathResult;
|
|
33
|
+
};
|
|
34
|
+
type TSConfigBaseUrlRelativePathLocalDependency = {
|
|
35
|
+
kind: 'tsconfig-baseurl-relative-path';
|
|
36
|
+
importPath: string;
|
|
37
|
+
configFile: TSConfigFile;
|
|
38
|
+
sourceFile: SourceFile;
|
|
39
|
+
};
|
|
40
|
+
type RelativePathLocalDependency = {
|
|
41
|
+
kind: 'relative-path';
|
|
42
|
+
importPath: string;
|
|
43
|
+
sourceFile: SourceFile;
|
|
44
|
+
};
|
|
45
|
+
type LocalDependency = TSConfigFileLocalDependency | TSConfigResolvedPathLocalDependency | TSConfigBaseUrlRelativePathLocalDependency | RelativePathLocalDependency;
|
|
46
|
+
type MissingDependency = {
|
|
47
|
+
importPath: string;
|
|
48
|
+
filePath: string;
|
|
49
|
+
};
|
|
50
|
+
type ExternalDependency = {
|
|
51
|
+
importPath: string;
|
|
52
|
+
};
|
|
53
|
+
export type Dependencies = {
|
|
54
|
+
external: ExternalDependency[];
|
|
55
|
+
missing: MissingDependency[];
|
|
56
|
+
local: LocalDependency[];
|
|
57
|
+
};
|
|
58
|
+
export declare class PackageFilesResolver {
|
|
59
|
+
cache: PackageFilesCache;
|
|
60
|
+
loadPackageFiles(filePath: string, options?: {
|
|
61
|
+
root?: string;
|
|
62
|
+
}): PackageFiles;
|
|
63
|
+
private resolveSourceFile;
|
|
64
|
+
resolveDependenciesForFilePath(filePath: string, dependencies: string[]): Dependencies;
|
|
65
|
+
}
|
|
66
|
+
export {};
|