@vxrn/resolve 2.0.0-beta.33.1 → 2.0.0-beta.45.1
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/cjs/index.cjs +48 -61
- package/dist/cjs/index.native.cjs +70 -0
- package/dist/cjs/index.native.js +51 -63
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/index.js +33 -35
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +33 -35
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +36 -38
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +2 -2
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/index.test.cjs +0 -52
- package/dist/cjs/index.test.native.js +0 -55
- package/dist/cjs/index.test.native.js.map +0 -1
- package/dist/esm/index.test.mjs +0 -53
- package/dist/esm/index.test.mjs.map +0 -1
- package/dist/esm/index.test.native.js +0 -53
- package/dist/esm/index.test.native.js.map +0 -1
- package/types/index.test.d.ts +0 -2
- package/types/index.test.d.ts.map +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,75 +5,62 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
12
|
};
|
|
13
13
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
21
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
30
25
|
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
27
|
var index_exports = {};
|
|
35
|
-
__export(index_exports, {
|
|
36
|
-
resolvePath: () => resolvePath
|
|
37
|
-
});
|
|
28
|
+
__export(index_exports, { resolvePath: () => resolvePath });
|
|
38
29
|
module.exports = __toCommonJS(index_exports);
|
|
39
30
|
var import_node_module = __toESM(require("node:module"), 1);
|
|
40
31
|
var import_node_path = require("node:path");
|
|
41
32
|
var import_node_fs = require("node:fs");
|
|
42
33
|
var import_node_url = require("node:url");
|
|
43
34
|
const resolvePath = (path, from = process.cwd()) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
} catch {}
|
|
78
|
-
return resolved;
|
|
79
|
-
};
|
|
35
|
+
if (process.platform === "win32" && from.startsWith("/")) {
|
|
36
|
+
try {
|
|
37
|
+
from = (0, import_node_url.fileURLToPath)("file://" + from);
|
|
38
|
+
} catch {
|
|
39
|
+
from = from.slice(1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
from = (0, import_node_path.resolve)(from);
|
|
43
|
+
const require2 = import_node_module.default.createRequire(from.endsWith("/") || from.endsWith("\\") ? from : from + "/");
|
|
44
|
+
const resolved = require2.resolve(path, { paths: [from] });
|
|
45
|
+
const isRelative = path.startsWith("./") || path.startsWith("../");
|
|
46
|
+
const isBuiltin = path.startsWith("node:");
|
|
47
|
+
if (isRelative || isBuiltin) {
|
|
48
|
+
return resolved;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });
|
|
52
|
+
const pkgJson = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf8"));
|
|
53
|
+
const pkgDir = (0, import_node_path.dirname)(pkgJsonPath);
|
|
54
|
+
const exportsImport = pkgJson.exports?.["."]?.import;
|
|
55
|
+
if (exportsImport) {
|
|
56
|
+
const importPath = typeof exportsImport === "string" ? exportsImport : exportsImport.default;
|
|
57
|
+
if (importPath) {
|
|
58
|
+
return (0, import_node_path.join)(pkgDir, importPath);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (pkgJson.module) {
|
|
62
|
+
return (0, import_node_path.join)(pkgDir, pkgJson.module);
|
|
63
|
+
}
|
|
64
|
+
} catch {}
|
|
65
|
+
return resolved;
|
|
66
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
27
|
+
}) : target, mod));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var index_exports = {};
|
|
30
|
+
__export(index_exports, { resolvePath: () => resolvePath });
|
|
31
|
+
module.exports = __toCommonJS(index_exports);
|
|
32
|
+
var import_module = __toESM(require("module"), 1);
|
|
33
|
+
var import_path = require("path");
|
|
34
|
+
var import_fs = require("fs");
|
|
35
|
+
var import_url = require("url");
|
|
36
|
+
var resolvePath = function(path) {
|
|
37
|
+
var from = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.cwd();
|
|
38
|
+
if (process.platform === "win32" && from.startsWith("/")) {
|
|
39
|
+
try {
|
|
40
|
+
from = (0, import_url.fileURLToPath)("file://" + from);
|
|
41
|
+
} catch (unused) {
|
|
42
|
+
from = from.slice(1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
from = (0, import_path.resolve)(from);
|
|
46
|
+
var require2 = import_module.default.createRequire(from.endsWith("/") || from.endsWith("\\") ? from : from + "/");
|
|
47
|
+
var resolved = require2.resolve(path, { paths: [from] });
|
|
48
|
+
var isRelative = path.startsWith("./") || path.startsWith("../");
|
|
49
|
+
var isBuiltin = path.startsWith("node:");
|
|
50
|
+
if (isRelative || isBuiltin) {
|
|
51
|
+
return resolved;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
var _pkgJson_exports_, _pkgJson_exports;
|
|
55
|
+
var pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });
|
|
56
|
+
var pkgJson = JSON.parse((0, import_fs.readFileSync)(pkgJsonPath, "utf8"));
|
|
57
|
+
var pkgDir = (0, import_path.dirname)(pkgJsonPath);
|
|
58
|
+
var exportsImport = (_pkgJson_exports = pkgJson.exports) === null || _pkgJson_exports === void 0 ? void 0 : (_pkgJson_exports_ = _pkgJson_exports["."]) === null || _pkgJson_exports_ === void 0 ? void 0 : _pkgJson_exports_.import;
|
|
59
|
+
if (exportsImport) {
|
|
60
|
+
var importPath = typeof exportsImport === "string" ? exportsImport : exportsImport.default;
|
|
61
|
+
if (importPath) {
|
|
62
|
+
return (0, import_path.join)(pkgDir, importPath);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (pkgJson.module) {
|
|
66
|
+
return (0, import_path.join)(pkgDir, pkgJson.module);
|
|
67
|
+
}
|
|
68
|
+
} catch (unused) {}
|
|
69
|
+
return resolved;
|
|
70
|
+
};
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -7,78 +7,66 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
14
|
};
|
|
15
15
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
23
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
32
27
|
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
29
|
var index_exports = {};
|
|
37
|
-
__export(index_exports, {
|
|
38
|
-
resolvePath: () => resolvePath
|
|
39
|
-
});
|
|
30
|
+
__export(index_exports, { resolvePath: () => resolvePath });
|
|
40
31
|
module.exports = __toCommonJS(index_exports);
|
|
41
32
|
var import_module = __toESM(require("module"), 1);
|
|
42
33
|
var import_path = require("path");
|
|
43
34
|
var import_fs = require("fs");
|
|
44
35
|
var import_url = require("url");
|
|
45
|
-
var resolvePath = function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return (0, import_path.join)(pkgDir, pkgJson.module);
|
|
80
|
-
}
|
|
81
|
-
} catch (unused) {}
|
|
82
|
-
return resolved;
|
|
36
|
+
var resolvePath = function(path) {
|
|
37
|
+
var from = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.cwd();
|
|
38
|
+
if (process.platform === "win32" && from.startsWith("/")) {
|
|
39
|
+
try {
|
|
40
|
+
from = (0, import_url.fileURLToPath)("file://" + from);
|
|
41
|
+
} catch (unused) {
|
|
42
|
+
from = from.slice(1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
from = (0, import_path.resolve)(from);
|
|
46
|
+
var require2 = import_module.default.createRequire(from.endsWith("/") || from.endsWith("\\") ? from : from + "/");
|
|
47
|
+
var resolved = require2.resolve(path, { paths: [from] });
|
|
48
|
+
var isRelative = path.startsWith("./") || path.startsWith("../");
|
|
49
|
+
var isBuiltin = path.startsWith("node:");
|
|
50
|
+
if (isRelative || isBuiltin) {
|
|
51
|
+
return resolved;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
var _pkgJson_exports_, _pkgJson_exports;
|
|
55
|
+
var pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });
|
|
56
|
+
var pkgJson = JSON.parse((0, import_fs.readFileSync)(pkgJsonPath, "utf8"));
|
|
57
|
+
var pkgDir = (0, import_path.dirname)(pkgJsonPath);
|
|
58
|
+
var exportsImport = (_pkgJson_exports = pkgJson.exports) === null || _pkgJson_exports === void 0 ? void 0 : (_pkgJson_exports_ = _pkgJson_exports["."]) === null || _pkgJson_exports_ === void 0 ? void 0 : _pkgJson_exports_.import;
|
|
59
|
+
if (exportsImport) {
|
|
60
|
+
var importPath = typeof exportsImport === "string" ? exportsImport : exportsImport.default;
|
|
61
|
+
if (importPath) {
|
|
62
|
+
return (0, import_path.join)(pkgDir, importPath);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (pkgJson.module) {
|
|
66
|
+
return (0, import_path.join)(pkgDir, pkgJson.module);
|
|
67
|
+
}
|
|
68
|
+
} catch (unused) {}
|
|
69
|
+
return resolved;
|
|
83
70
|
};
|
|
71
|
+
|
|
84
72
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n resolvePath: () => resolvePath\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_module = __toESM(require(\"module\"), 1);\nvar import_path = require(\"path\");\nvar import_fs = require(\"fs\");\nvar import_url = require(\"url\");\nvar resolvePath = function(path) {\n var from = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.cwd();\n if (process.platform === \"win32\" && from.startsWith(\"/\")) {\n try {\n from = (0, import_url.fileURLToPath)(\"file://\" + from);\n } catch (unused) {\n from = from.slice(1);\n }\n }\n from = (0, import_path.resolve)(from);\n var require2 = import_module.default.createRequire(from.endsWith(\"/\") || from.endsWith(\"\\\\\") ? from : from + \"/\");\n var resolved = require2.resolve(path, {\n paths: [\n from\n ]\n });\n var isRelative = path.startsWith(\"./\") || path.startsWith(\"../\");\n var isBuiltin = path.startsWith(\"node:\");\n if (isRelative || isBuiltin) {\n return resolved;\n }\n try {\n var _pkgJson_exports_, _pkgJson_exports;\n var pkgJsonPath = require2.resolve(`${path}/package.json`, {\n paths: [\n from\n ]\n });\n var pkgJson = JSON.parse((0, import_fs.readFileSync)(pkgJsonPath, \"utf8\"));\n var pkgDir = (0, import_path.dirname)(pkgJsonPath);\n var exportsImport = (_pkgJson_exports = pkgJson.exports) === null || _pkgJson_exports === void 0 ? void 0 : (_pkgJson_exports_ = _pkgJson_exports[\".\"]) === null || _pkgJson_exports_ === void 0 ? void 0 : _pkgJson_exports_.import;\n if (exportsImport) {\n var importPath = typeof exportsImport === \"string\" ? exportsImport : exportsImport.default;\n if (importPath) {\n return (0, import_path.join)(pkgDir, importPath);\n }\n }\n if (pkgJson.module) {\n return (0, import_path.join)(pkgDir, pkgJson.module);\n }\n } catch (unused) {\n }\n return resolved;\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;C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GAAG,YAAY,QAAO,CAAE,WAAW;EACjD,IAAI,iBAAiB,mBAAmB,QAAQ,aAAa,QAAQ,qBAAqB,KAAK,IAAI,KAAK,KAAK,oBAAoB,iBAAiB,UAAU,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB;EAC9N,IAAI,eAAe;GACjB,IAAI,aAAa,OAAO,kBAAkB,WAAW,gBAAgB,cAAc;GACnF,IAAI,YAAY;IACd,QAAQ,GAAG,YAAY,KAAI,CAAE,QAAQ,UAAU;GACjD;EACF;EACA,IAAI,QAAQ,QAAQ;GAClB,QAAQ,GAAG,YAAY,KAAI,CAAE,QAAQ,QAAQ,MAAM;EACrD;CACF,SAAS,QAAQ,CACjB;CACA,OAAO;AACT"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,42 +2,40 @@ import module from "node:module";
|
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
5
6
|
const resolvePath = (path, from = process.cwd()) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return join(pkgDir, pkgJson.module);
|
|
38
|
-
}
|
|
39
|
-
} catch {}
|
|
40
|
-
return resolved;
|
|
7
|
+
if (process.platform === "win32" && from.startsWith("/")) {
|
|
8
|
+
try {
|
|
9
|
+
from = fileURLToPath("file://" + from);
|
|
10
|
+
} catch {
|
|
11
|
+
from = from.slice(1);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
from = resolve(from);
|
|
15
|
+
const require2 = module.createRequire(from.endsWith("/") || from.endsWith("\\") ? from : from + "/");
|
|
16
|
+
const resolved = require2.resolve(path, { paths: [from] });
|
|
17
|
+
const isRelative = path.startsWith("./") || path.startsWith("../");
|
|
18
|
+
const isBuiltin = path.startsWith("node:");
|
|
19
|
+
if (isRelative || isBuiltin) {
|
|
20
|
+
return resolved;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });
|
|
24
|
+
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf8"));
|
|
25
|
+
const pkgDir = dirname(pkgJsonPath);
|
|
26
|
+
const exportsImport = pkgJson.exports?.["."]?.import;
|
|
27
|
+
if (exportsImport) {
|
|
28
|
+
const importPath = typeof exportsImport === "string" ? exportsImport : exportsImport.default;
|
|
29
|
+
if (importPath) {
|
|
30
|
+
return join(pkgDir, importPath);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (pkgJson.module) {
|
|
34
|
+
return join(pkgDir, pkgJson.module);
|
|
35
|
+
}
|
|
36
|
+
} catch {}
|
|
37
|
+
return resolved;
|
|
41
38
|
};
|
|
39
|
+
|
|
42
40
|
export { resolvePath };
|
|
43
41
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import module from \"node:module\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nconst resolvePath = (path, from = process.cwd()) => {\n if (process.platform === \"win32\" && from.startsWith(\"/\")) {\n try {\n from = fileURLToPath(\"file://\" + from);\n } catch {\n from = from.slice(1);\n }\n }\n from = resolve(from);\n const require2 = module.createRequire(\n from.endsWith(\"/\") || from.endsWith(\"\\\\\") ? from : from + \"/\"\n );\n const resolved = require2.resolve(path, { paths: [from] });\n const isRelative = path.startsWith(\"./\") || path.startsWith(\"../\");\n const isBuiltin = path.startsWith(\"node:\");\n if (isRelative || isBuiltin) {\n return resolved;\n }\n try {\n const pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });\n const pkgJson = JSON.parse(readFileSync(pkgJsonPath, \"utf8\"));\n const pkgDir = dirname(pkgJsonPath);\n const exportsImport = pkgJson.exports?.[\".\"]?.import;\n if (exportsImport) {\n const importPath = typeof exportsImport === \"string\" ? exportsImport : exportsImport.default;\n if (importPath) {\n return join(pkgDir, importPath);\n }\n }\n if (pkgJson.module) {\n return join(pkgDir, pkgJson.module);\n }\n } catch {\n }\n return resolved;\n};\nexport {\n resolvePath\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAIA,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI,MAAM;CAClD,IAAI,QAAQ,aAAa,WAAW,KAAK,WAAW,GAAG,GAAG;EACxD,IAAI;GACF,OAAO,cAAc,YAAY,IAAI;EACvC,QAAQ;GACN,OAAO,KAAK,MAAM,CAAC;EACrB;CACF;CACA,OAAO,QAAQ,IAAI;CACnB,MAAM,WAAW,OAAO,cACtB,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,IAAI,OAAO,OAAO,GAC5D;CACA,MAAM,WAAW,SAAS,QAAQ,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;CACzD,MAAM,aAAa,KAAK,WAAW,IAAI,KAAK,KAAK,WAAW,KAAK;CACjE,MAAM,YAAY,KAAK,WAAW,OAAO;CACzC,IAAI,cAAc,WAAW;EAC3B,OAAO;CACT;CACA,IAAI;EACF,MAAM,cAAc,SAAS,QAAQ,GAAG,KAAK,gBAAgB,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;EAC9E,MAAM,UAAU,KAAK,MAAM,aAAa,aAAa,MAAM,CAAC;EAC5D,MAAM,SAAS,QAAQ,WAAW;EAClC,MAAM,gBAAgB,QAAQ,UAAU,IAAI,EAAE;EAC9C,IAAI,eAAe;GACjB,MAAM,aAAa,OAAO,kBAAkB,WAAW,gBAAgB,cAAc;GACrF,IAAI,YAAY;IACd,OAAO,KAAK,QAAQ,UAAU;GAChC;EACF;EACA,IAAI,QAAQ,QAAQ;GAClB,OAAO,KAAK,QAAQ,QAAQ,MAAM;EACpC;CACF,QAAQ,CACR;CACA,OAAO;AACT"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,42 +2,40 @@ import module from "node:module";
|
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
5
6
|
const resolvePath = (path, from = process.cwd()) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return join(pkgDir, pkgJson.module);
|
|
38
|
-
}
|
|
39
|
-
} catch {}
|
|
40
|
-
return resolved;
|
|
7
|
+
if (process.platform === "win32" && from.startsWith("/")) {
|
|
8
|
+
try {
|
|
9
|
+
from = fileURLToPath("file://" + from);
|
|
10
|
+
} catch {
|
|
11
|
+
from = from.slice(1);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
from = resolve(from);
|
|
15
|
+
const require2 = module.createRequire(from.endsWith("/") || from.endsWith("\\") ? from : from + "/");
|
|
16
|
+
const resolved = require2.resolve(path, { paths: [from] });
|
|
17
|
+
const isRelative = path.startsWith("./") || path.startsWith("../");
|
|
18
|
+
const isBuiltin = path.startsWith("node:");
|
|
19
|
+
if (isRelative || isBuiltin) {
|
|
20
|
+
return resolved;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });
|
|
24
|
+
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf8"));
|
|
25
|
+
const pkgDir = dirname(pkgJsonPath);
|
|
26
|
+
const exportsImport = pkgJson.exports?.["."]?.import;
|
|
27
|
+
if (exportsImport) {
|
|
28
|
+
const importPath = typeof exportsImport === "string" ? exportsImport : exportsImport.default;
|
|
29
|
+
if (importPath) {
|
|
30
|
+
return join(pkgDir, importPath);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (pkgJson.module) {
|
|
34
|
+
return join(pkgDir, pkgJson.module);
|
|
35
|
+
}
|
|
36
|
+
} catch {}
|
|
37
|
+
return resolved;
|
|
41
38
|
};
|
|
39
|
+
|
|
42
40
|
export { resolvePath };
|
|
43
41
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import module from \"node:module\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nconst resolvePath = (path, from = process.cwd()) => {\n if (process.platform === \"win32\" && from.startsWith(\"/\")) {\n try {\n from = fileURLToPath(\"file://\" + from);\n } catch {\n from = from.slice(1);\n }\n }\n from = resolve(from);\n const require2 = module.createRequire(\n from.endsWith(\"/\") || from.endsWith(\"\\\\\") ? from : from + \"/\"\n );\n const resolved = require2.resolve(path, { paths: [from] });\n const isRelative = path.startsWith(\"./\") || path.startsWith(\"../\");\n const isBuiltin = path.startsWith(\"node:\");\n if (isRelative || isBuiltin) {\n return resolved;\n }\n try {\n const pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });\n const pkgJson = JSON.parse(readFileSync(pkgJsonPath, \"utf8\"));\n const pkgDir = dirname(pkgJsonPath);\n const exportsImport = pkgJson.exports?.[\".\"]?.import;\n if (exportsImport) {\n const importPath = typeof exportsImport === \"string\" ? exportsImport : exportsImport.default;\n if (importPath) {\n return join(pkgDir, importPath);\n }\n }\n if (pkgJson.module) {\n return join(pkgDir, pkgJson.module);\n }\n } catch {\n }\n return resolved;\n};\nexport {\n resolvePath\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAIA,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI,MAAM;CAClD,IAAI,QAAQ,aAAa,WAAW,KAAK,WAAW,GAAG,GAAG;EACxD,IAAI;GACF,OAAO,cAAc,YAAY,IAAI;EACvC,QAAQ;GACN,OAAO,KAAK,MAAM,CAAC;EACrB;CACF;CACA,OAAO,QAAQ,IAAI;CACnB,MAAM,WAAW,OAAO,cACtB,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,IAAI,OAAO,OAAO,GAC5D;CACA,MAAM,WAAW,SAAS,QAAQ,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;CACzD,MAAM,aAAa,KAAK,WAAW,IAAI,KAAK,KAAK,WAAW,KAAK;CACjE,MAAM,YAAY,KAAK,WAAW,OAAO;CACzC,IAAI,cAAc,WAAW;EAC3B,OAAO;CACT;CACA,IAAI;EACF,MAAM,cAAc,SAAS,QAAQ,GAAG,KAAK,gBAAgB,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;EAC9E,MAAM,UAAU,KAAK,MAAM,aAAa,aAAa,MAAM,CAAC;EAC5D,MAAM,SAAS,QAAQ,WAAW;EAClC,MAAM,gBAAgB,QAAQ,UAAU,IAAI,EAAE;EAC9C,IAAI,eAAe;GACjB,MAAM,aAAa,OAAO,kBAAkB,WAAW,gBAAgB,cAAc;GACrF,IAAI,YAAY;IACd,OAAO,KAAK,QAAQ,UAAU;GAChC;EACF;EACA,IAAI,QAAQ,QAAQ;GAClB,OAAO,KAAK,QAAQ,QAAQ,MAAM;EACpC;CACF,QAAQ,CACR;CACA,OAAO;AACT"}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -2,44 +2,42 @@ import module from "module";
|
|
|
2
2
|
import { dirname, join, resolve } from "path";
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
} catch (unused) {}
|
|
42
|
-
return resolved;
|
|
5
|
+
|
|
6
|
+
var resolvePath = function(path) {
|
|
7
|
+
var from = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.cwd();
|
|
8
|
+
if (process.platform === "win32" && from.startsWith("/")) {
|
|
9
|
+
try {
|
|
10
|
+
from = fileURLToPath("file://" + from);
|
|
11
|
+
} catch (unused) {
|
|
12
|
+
from = from.slice(1);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
from = resolve(from);
|
|
16
|
+
var require2 = module.createRequire(from.endsWith("/") || from.endsWith("\\") ? from : from + "/");
|
|
17
|
+
var resolved = require2.resolve(path, { paths: [from] });
|
|
18
|
+
var isRelative = path.startsWith("./") || path.startsWith("../");
|
|
19
|
+
var isBuiltin = path.startsWith("node:");
|
|
20
|
+
if (isRelative || isBuiltin) {
|
|
21
|
+
return resolved;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
var _pkgJson_exports_, _pkgJson_exports;
|
|
25
|
+
var pkgJsonPath = require2.resolve(`${path}/package.json`, { paths: [from] });
|
|
26
|
+
var pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf8"));
|
|
27
|
+
var pkgDir = dirname(pkgJsonPath);
|
|
28
|
+
var exportsImport = (_pkgJson_exports = pkgJson.exports) === null || _pkgJson_exports === void 0 ? void 0 : (_pkgJson_exports_ = _pkgJson_exports["."]) === null || _pkgJson_exports_ === void 0 ? void 0 : _pkgJson_exports_.import;
|
|
29
|
+
if (exportsImport) {
|
|
30
|
+
var importPath = typeof exportsImport === "string" ? exportsImport : exportsImport.default;
|
|
31
|
+
if (importPath) {
|
|
32
|
+
return join(pkgDir, importPath);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (pkgJson.module) {
|
|
36
|
+
return join(pkgDir, pkgJson.module);
|
|
37
|
+
}
|
|
38
|
+
} catch (unused) {}
|
|
39
|
+
return resolved;
|
|
43
40
|
};
|
|
41
|
+
|
|
44
42
|
export { resolvePath };
|
|
45
43
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import module from \"module\";\nimport { dirname, join, resolve } from \"path\";\nimport { readFileSync } from \"fs\";\nimport { fileURLToPath } from \"url\";\nvar resolvePath = function(path) {\n var from = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.cwd();\n if (process.platform === \"win32\" && from.startsWith(\"/\")) {\n try {\n from = fileURLToPath(\"file://\" + from);\n } catch (unused) {\n from = from.slice(1);\n }\n }\n from = resolve(from);\n var require2 = module.createRequire(from.endsWith(\"/\") || from.endsWith(\"\\\\\") ? from : from + \"/\");\n var resolved = require2.resolve(path, {\n paths: [\n from\n ]\n });\n var isRelative = path.startsWith(\"./\") || path.startsWith(\"../\");\n var isBuiltin = path.startsWith(\"node:\");\n if (isRelative || isBuiltin) {\n return resolved;\n }\n try {\n var _pkgJson_exports_, _pkgJson_exports;\n var pkgJsonPath = require2.resolve(`${path}/package.json`, {\n paths: [\n from\n ]\n });\n var pkgJson = JSON.parse(readFileSync(pkgJsonPath, \"utf8\"));\n var pkgDir = dirname(pkgJsonPath);\n var exportsImport = (_pkgJson_exports = pkgJson.exports) === null || _pkgJson_exports === void 0 ? void 0 : (_pkgJson_exports_ = _pkgJson_exports[\".\"]) === null || _pkgJson_exports_ === void 0 ? void 0 : _pkgJson_exports_.import;\n if (exportsImport) {\n var importPath = typeof exportsImport === \"string\" ? exportsImport : exportsImport.default;\n if (importPath) {\n return join(pkgDir, importPath);\n }\n }\n if (pkgJson.module) {\n return join(pkgDir, pkgJson.module);\n }\n } catch (unused) {\n }\n return resolved;\n};\nexport {\n resolvePath\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAIA,IAAI,cAAc,SAAS,MAAM;CAC/B,IAAI,OAAO,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,QAAQ,IAAI;CACxF,IAAI,QAAQ,aAAa,WAAW,KAAK,WAAW,GAAG,GAAG;EACxD,IAAI;GACF,OAAO,cAAc,YAAY,IAAI;EACvC,SAAS,QAAQ;GACf,OAAO,KAAK,MAAM,CAAC;EACrB;CACF;CACA,OAAO,QAAQ,IAAI;CACnB,IAAI,WAAW,OAAO,cAAc,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,IAAI,OAAO,OAAO,GAAG;CACjG,IAAI,WAAW,SAAS,QAAQ,MAAM,EACpC,OAAO,CACL,IACF,EACF,CAAC;CACD,IAAI,aAAa,KAAK,WAAW,IAAI,KAAK,KAAK,WAAW,KAAK;CAC/D,IAAI,YAAY,KAAK,WAAW,OAAO;CACvC,IAAI,cAAc,WAAW;EAC3B,OAAO;CACT;CACA,IAAI;EACF,IAAI,mBAAmB;EACvB,IAAI,cAAc,SAAS,QAAQ,GAAG,KAAK,gBAAgB,EACzD,OAAO,CACL,IACF,EACF,CAAC;EACD,IAAI,UAAU,KAAK,MAAM,aAAa,aAAa,MAAM,CAAC;EAC1D,IAAI,SAAS,QAAQ,WAAW;EAChC,IAAI,iBAAiB,mBAAmB,QAAQ,aAAa,QAAQ,qBAAqB,KAAK,IAAI,KAAK,KAAK,oBAAoB,iBAAiB,UAAU,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB;EAC9N,IAAI,eAAe;GACjB,IAAI,aAAa,OAAO,kBAAkB,WAAW,gBAAgB,cAAc;GACnF,IAAI,YAAY;IACd,OAAO,KAAK,QAAQ,UAAU;GAChC;EACF;EACA,IAAI,QAAQ,QAAQ;GAClB,OAAO,KAAK,QAAQ,QAAQ,MAAM;EACpC;CACF,SAAS,QAAQ,CACjB;CACA,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxrn/resolve",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.45.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tamagui/build": "
|
|
34
|
+
"@tamagui/build": "3.0.0-beta.1309.1",
|
|
35
35
|
"vitest": "^4.1.0"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,oBAAyB,MA+ChE,CAAA"}
|
package/dist/cjs/index.test.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var import_vitest = require("vitest");
|
|
2
|
-
var import_index = require("./index.cjs");
|
|
3
|
-
var import_node_fs = require("node:fs");
|
|
4
|
-
var import_node_path = require("node:path");
|
|
5
|
-
(0, import_vitest.describe)("resolvePath", () => {
|
|
6
|
-
(0, import_vitest.describe)("basic resolution", () => {
|
|
7
|
-
(0, import_vitest.it)("resolves node builtins", () => {
|
|
8
|
-
(0, import_vitest.expect)((0, import_index.resolvePath)("node:path")).toBe("node:path");
|
|
9
|
-
(0, import_vitest.expect)((0, import_index.resolvePath)("node:fs")).toBe("node:fs");
|
|
10
|
-
});
|
|
11
|
-
(0, import_vitest.it)("resolves npm packages", () => {
|
|
12
|
-
const path = (0, import_index.resolvePath)("vitest");
|
|
13
|
-
(0, import_vitest.expect)(path).toBeTruthy();
|
|
14
|
-
(0, import_vitest.expect)((0, import_node_fs.existsSync)(path)).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
(0, import_vitest.it)("resolves relative paths from cwd", () => {
|
|
17
|
-
const path = (0, import_index.resolvePath)("./package.json");
|
|
18
|
-
(0, import_vitest.expect)(path).toContain("package.json");
|
|
19
|
-
(0, import_vitest.expect)((0, import_node_fs.existsSync)(path)).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
(0, import_vitest.describe)("respects from parameter", () => {
|
|
23
|
-
(0, import_vitest.it)("resolves relative paths from specified directory", () => {
|
|
24
|
-
const path = (0, import_index.resolvePath)("./package.json", process.cwd());
|
|
25
|
-
(0, import_vitest.expect)(path).toBe((0, import_node_path.join)(process.cwd(), "package.json"));
|
|
26
|
-
(0, import_vitest.expect)((0, import_node_fs.existsSync)(path)).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
(0, import_vitest.it)("resolves npm packages from specified directory", () => {
|
|
29
|
-
const path = (0, import_index.resolvePath)("vitest", process.cwd());
|
|
30
|
-
(0, import_vitest.expect)(path).toContain("vitest");
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
(0, import_vitest.describe)("ESM entry point detection", () => {
|
|
34
|
-
(0, import_vitest.it)('returns ESM entry when exports["."].import is a string', () => {
|
|
35
|
-
const path = (0, import_index.resolvePath)("@vxrn/resolve", process.cwd());
|
|
36
|
-
(0, import_vitest.expect)(path).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
(0, import_vitest.it)('returns ESM entry when exports["."].import.default exists', () => {
|
|
39
|
-
const path = (0, import_index.resolvePath)("vitest", process.cwd());
|
|
40
|
-
(0, import_vitest.expect)(path).toContain((0, import_node_path.join)("dist", "index.js"));
|
|
41
|
-
(0, import_vitest.expect)(path).not.toContain(".cjs");
|
|
42
|
-
});
|
|
43
|
-
(0, import_vitest.it)("falls back to module field when exports not available", () => {
|
|
44
|
-
const path = (0, import_index.resolvePath)("vitest", process.cwd());
|
|
45
|
-
(0, import_vitest.expect)(path).toBeTruthy();
|
|
46
|
-
});
|
|
47
|
-
(0, import_vitest.it)("falls back to main/require.resolve when no ESM entry", () => {
|
|
48
|
-
const path = (0, import_index.resolvePath)("resolve", process.cwd());
|
|
49
|
-
(0, import_vitest.expect)(path).toContain("resolve");
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var import_vitest = require("vitest");
|
|
4
|
-
var import_index = require("./index.native.js");
|
|
5
|
-
var import_fs = require("fs");
|
|
6
|
-
var import_path = require("path");
|
|
7
|
-
(0, import_vitest.describe)("resolvePath", function () {
|
|
8
|
-
(0, import_vitest.describe)("basic resolution", function () {
|
|
9
|
-
(0, import_vitest.it)("resolves node builtins", function () {
|
|
10
|
-
(0, import_vitest.expect)((0, import_index.resolvePath)("node:path")).toBe("node:path");
|
|
11
|
-
(0, import_vitest.expect)((0, import_index.resolvePath)("node:fs")).toBe("node:fs");
|
|
12
|
-
});
|
|
13
|
-
(0, import_vitest.it)("resolves npm packages", function () {
|
|
14
|
-
var path = (0, import_index.resolvePath)("vitest");
|
|
15
|
-
(0, import_vitest.expect)(path).toBeTruthy();
|
|
16
|
-
(0, import_vitest.expect)((0, import_fs.existsSync)(path)).toBe(true);
|
|
17
|
-
});
|
|
18
|
-
(0, import_vitest.it)("resolves relative paths from cwd", function () {
|
|
19
|
-
var path = (0, import_index.resolvePath)("./package.json");
|
|
20
|
-
(0, import_vitest.expect)(path).toContain("package.json");
|
|
21
|
-
(0, import_vitest.expect)((0, import_fs.existsSync)(path)).toBe(true);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
(0, import_vitest.describe)("respects from parameter", function () {
|
|
25
|
-
(0, import_vitest.it)("resolves relative paths from specified directory", function () {
|
|
26
|
-
var path = (0, import_index.resolvePath)("./package.json", process.cwd());
|
|
27
|
-
(0, import_vitest.expect)(path).toBe((0, import_path.join)(process.cwd(), "package.json"));
|
|
28
|
-
(0, import_vitest.expect)((0, import_fs.existsSync)(path)).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
(0, import_vitest.it)("resolves npm packages from specified directory", function () {
|
|
31
|
-
var path = (0, import_index.resolvePath)("vitest", process.cwd());
|
|
32
|
-
(0, import_vitest.expect)(path).toContain("vitest");
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
(0, import_vitest.describe)("ESM entry point detection", function () {
|
|
36
|
-
(0, import_vitest.it)('returns ESM entry when exports["."].import is a string', function () {
|
|
37
|
-
var path = (0, import_index.resolvePath)("@vxrn/resolve", process.cwd());
|
|
38
|
-
(0, import_vitest.expect)(path).toBeTruthy();
|
|
39
|
-
});
|
|
40
|
-
(0, import_vitest.it)('returns ESM entry when exports["."].import.default exists', function () {
|
|
41
|
-
var path = (0, import_index.resolvePath)("vitest", process.cwd());
|
|
42
|
-
(0, import_vitest.expect)(path).toContain((0, import_path.join)("dist", "index.js"));
|
|
43
|
-
(0, import_vitest.expect)(path).not.toContain(".cjs");
|
|
44
|
-
});
|
|
45
|
-
(0, import_vitest.it)("falls back to module field when exports not available", function () {
|
|
46
|
-
var path = (0, import_index.resolvePath)("vitest", process.cwd());
|
|
47
|
-
(0, import_vitest.expect)(path).toBeTruthy();
|
|
48
|
-
});
|
|
49
|
-
(0, import_vitest.it)("falls back to main/require.resolve when no ESM entry", function () {
|
|
50
|
-
var path = (0, import_index.resolvePath)("resolve", process.cwd());
|
|
51
|
-
(0, import_vitest.expect)(path).toContain("resolve");
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=index.test.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["import_vitest","require","import_index","import_fs","import_path","describe","it","expect","resolvePath","toBe","path","toBeTruthy","existsSync","toContain","process","cwd","join","not"],"sources":["index.test.native.js"],"sourcesContent":["\"use strict\";\nvar import_vitest = require(\"vitest\");\nvar import_index = require(\"./index\");\nvar import_fs = require(\"fs\");\nvar import_path = require(\"path\");\n(0, import_vitest.describe)(\"resolvePath\", function() {\n (0, import_vitest.describe)(\"basic resolution\", function() {\n (0, import_vitest.it)(\"resolves node builtins\", function() {\n (0, import_vitest.expect)((0, import_index.resolvePath)(\"node:path\")).toBe(\"node:path\");\n (0, import_vitest.expect)((0, import_index.resolvePath)(\"node:fs\")).toBe(\"node:fs\");\n });\n (0, import_vitest.it)(\"resolves npm packages\", function() {\n var path = (0, import_index.resolvePath)(\"vitest\");\n (0, import_vitest.expect)(path).toBeTruthy();\n (0, import_vitest.expect)((0, import_fs.existsSync)(path)).toBe(true);\n });\n (0, import_vitest.it)(\"resolves relative paths from cwd\", function() {\n var path = (0, import_index.resolvePath)(\"./package.json\");\n (0, import_vitest.expect)(path).toContain(\"package.json\");\n (0, import_vitest.expect)((0, import_fs.existsSync)(path)).toBe(true);\n });\n });\n (0, import_vitest.describe)(\"respects from parameter\", function() {\n (0, import_vitest.it)(\"resolves relative paths from specified directory\", function() {\n var path = (0, import_index.resolvePath)(\"./package.json\", process.cwd());\n (0, import_vitest.expect)(path).toBe((0, import_path.join)(process.cwd(), \"package.json\"));\n (0, import_vitest.expect)((0, import_fs.existsSync)(path)).toBe(true);\n });\n (0, import_vitest.it)(\"resolves npm packages from specified directory\", function() {\n var path = (0, import_index.resolvePath)(\"vitest\", process.cwd());\n (0, import_vitest.expect)(path).toContain(\"vitest\");\n });\n });\n (0, import_vitest.describe)(\"ESM entry point detection\", function() {\n (0, import_vitest.it)('returns ESM entry when exports[\".\"].import is a string', function() {\n var path = (0, import_index.resolvePath)(\"@vxrn/resolve\", process.cwd());\n (0, import_vitest.expect)(path).toBeTruthy();\n });\n (0, import_vitest.it)('returns ESM entry when exports[\".\"].import.default exists', function() {\n var path = (0, import_index.resolvePath)(\"vitest\", process.cwd());\n (0, import_vitest.expect)(path).toContain((0, import_path.join)(\"dist\", \"index.js\"));\n (0, import_vitest.expect)(path).not.toContain(\".cjs\");\n });\n (0, import_vitest.it)(\"falls back to module field when exports not available\", function() {\n var path = (0, import_index.resolvePath)(\"vitest\", process.cwd());\n (0, import_vitest.expect)(path).toBeTruthy();\n });\n (0, import_vitest.it)(\"falls back to main/require.resolve when no ESM entry\", function() {\n var path = (0, import_index.resolvePath)(\"resolve\", process.cwd());\n (0, import_vitest.expect)(path).toContain(\"resolve\");\n });\n });\n});\n//# sourceMappingURL=index.test.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,aAAa,GAAGC,OAAO,CAAC,QAAQ,CAAC;AACrC,IAAIC,YAAY,GAAGD,OAAO,CAAC,mBAAS,CAAC;AACrC,IAAIE,SAAS,GAAGF,OAAO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;IACtD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/dist/esm/index.test.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { resolvePath } from "./index.mjs";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
describe("resolvePath", () => {
|
|
6
|
-
describe("basic resolution", () => {
|
|
7
|
-
it("resolves node builtins", () => {
|
|
8
|
-
expect(resolvePath("node:path")).toBe("node:path");
|
|
9
|
-
expect(resolvePath("node:fs")).toBe("node:fs");
|
|
10
|
-
});
|
|
11
|
-
it("resolves npm packages", () => {
|
|
12
|
-
const path = resolvePath("vitest");
|
|
13
|
-
expect(path).toBeTruthy();
|
|
14
|
-
expect(existsSync(path)).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
it("resolves relative paths from cwd", () => {
|
|
17
|
-
const path = resolvePath("./package.json");
|
|
18
|
-
expect(path).toContain("package.json");
|
|
19
|
-
expect(existsSync(path)).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
describe("respects from parameter", () => {
|
|
23
|
-
it("resolves relative paths from specified directory", () => {
|
|
24
|
-
const path = resolvePath("./package.json", process.cwd());
|
|
25
|
-
expect(path).toBe(join(process.cwd(), "package.json"));
|
|
26
|
-
expect(existsSync(path)).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
it("resolves npm packages from specified directory", () => {
|
|
29
|
-
const path = resolvePath("vitest", process.cwd());
|
|
30
|
-
expect(path).toContain("vitest");
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
describe("ESM entry point detection", () => {
|
|
34
|
-
it('returns ESM entry when exports["."].import is a string', () => {
|
|
35
|
-
const path = resolvePath("@vxrn/resolve", process.cwd());
|
|
36
|
-
expect(path).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
it('returns ESM entry when exports["."].import.default exists', () => {
|
|
39
|
-
const path = resolvePath("vitest", process.cwd());
|
|
40
|
-
expect(path).toContain(join("dist", "index.js"));
|
|
41
|
-
expect(path).not.toContain(".cjs");
|
|
42
|
-
});
|
|
43
|
-
it("falls back to module field when exports not available", () => {
|
|
44
|
-
const path = resolvePath("vitest", process.cwd());
|
|
45
|
-
expect(path).toBeTruthy();
|
|
46
|
-
});
|
|
47
|
-
it("falls back to main/require.resolve when no ESM entry", () => {
|
|
48
|
-
const path = resolvePath("resolve", process.cwd());
|
|
49
|
-
expect(path).toContain("resolve");
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=index.test.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["describe","expect","it","resolvePath","existsSync","join","toBe","path","toBeTruthy","toContain","process","cwd","not"],"sources":["../../src/index.test.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,EAAUC,MAAA,EAAQC,EAAA,QAAU;AACrC,SAASC,WAAA,QAAmB;AAC5B,SAASC,UAAA,QAAkB;AAC3B,SAASC,IAAA,QAAY;AAErBL,QAAA,CAAS,eAAe,MAAM;EAC5BA,QAAA,CAAS,oBAAoB,MAAM;IACjCE,EAAA,CAAG,0BAA0B,MAAM;MACjCD,MAAA,CAAOE,WAAA,CAAY,WAAW,CAAC,EAAEG,IAAA,CAAK,WAAW;MACjDL,MAAA,CAAOE,WAAA,CAAY,SAAS,CAAC,EAAEG,IAAA,CAAK,SAAS;IAC/C,CAAC;IAEDJ,EAAA,CAAG,yBAAyB,MAAM;MAChC,MAAMK,IAAA,GAAOJ,WAAA,CAAY,QAAQ;MACjCF,MAAA,CAAOM,IAAI,EAAEC,UAAA,CAAW;MACxBP,MAAA,CAAOG,UAAA,CAAWG,IAAI,CAAC,EAAED,IAAA,CAAK,IAAI;IACpC,CAAC;IAEDJ,EAAA,CAAG,oCAAoC,MAAM;MAC3C,MAAMK,IAAA,GAAOJ,WAAA,CAAY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,UAAUO,OAAA,CAAQC,GAAA,CAAI,CAAC;MAChDV,MAAA,CAAOM,IAAI,EAAEC,UAAA,CAAW;IAC1B,CAAC;IAEDN,EAAA,CAAG,wDAAwD,MAAM;MAE/D,MAAMK,IAAA,GAAOJ,WAAA,CAAY,WAAWO,OAAA,CAAQC,GAAA,CAAI,CAAC;MACjDV,MAAA,CAAOM,IAAI,EAAEE,SAAA,CAAU,SAAS;IAClC,CAAC;EACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { resolvePath } from "./index.native.js";
|
|
3
|
-
import { existsSync } from "fs";
|
|
4
|
-
import { join } from "path";
|
|
5
|
-
describe("resolvePath", function () {
|
|
6
|
-
describe("basic resolution", function () {
|
|
7
|
-
it("resolves node builtins", function () {
|
|
8
|
-
expect(resolvePath("node:path")).toBe("node:path");
|
|
9
|
-
expect(resolvePath("node:fs")).toBe("node:fs");
|
|
10
|
-
});
|
|
11
|
-
it("resolves npm packages", function () {
|
|
12
|
-
var path = resolvePath("vitest");
|
|
13
|
-
expect(path).toBeTruthy();
|
|
14
|
-
expect(existsSync(path)).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
it("resolves relative paths from cwd", function () {
|
|
17
|
-
var path = resolvePath("./package.json");
|
|
18
|
-
expect(path).toContain("package.json");
|
|
19
|
-
expect(existsSync(path)).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
describe("respects from parameter", function () {
|
|
23
|
-
it("resolves relative paths from specified directory", function () {
|
|
24
|
-
var path = resolvePath("./package.json", process.cwd());
|
|
25
|
-
expect(path).toBe(join(process.cwd(), "package.json"));
|
|
26
|
-
expect(existsSync(path)).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
it("resolves npm packages from specified directory", function () {
|
|
29
|
-
var path = resolvePath("vitest", process.cwd());
|
|
30
|
-
expect(path).toContain("vitest");
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
describe("ESM entry point detection", function () {
|
|
34
|
-
it('returns ESM entry when exports["."].import is a string', function () {
|
|
35
|
-
var path = resolvePath("@vxrn/resolve", process.cwd());
|
|
36
|
-
expect(path).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
it('returns ESM entry when exports["."].import.default exists', function () {
|
|
39
|
-
var path = resolvePath("vitest", process.cwd());
|
|
40
|
-
expect(path).toContain(join("dist", "index.js"));
|
|
41
|
-
expect(path).not.toContain(".cjs");
|
|
42
|
-
});
|
|
43
|
-
it("falls back to module field when exports not available", function () {
|
|
44
|
-
var path = resolvePath("vitest", process.cwd());
|
|
45
|
-
expect(path).toBeTruthy();
|
|
46
|
-
});
|
|
47
|
-
it("falls back to main/require.resolve when no ESM entry", function () {
|
|
48
|
-
var path = resolvePath("resolve", process.cwd());
|
|
49
|
-
expect(path).toContain("resolve");
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=index.test.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["describe","expect","it","resolvePath","existsSync","join","toBe","path","toBeTruthy","toContain","process","cwd","not"],"sources":["../../src/index.test.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,EAAUC,MAAA,EAAQC,EAAA,QAAU;AACrC,SAASC,WAAA,QAAmB;AAC5B,SAASC,UAAA,QAAkB;AAC3B,SAASC,IAAA,QAAY;AAErBL,QAAA,CAAS,eAAe,YAAM;EAC5BA,QAAA,CAAS,oBAAoB,YAAM;IACjCE,EAAA,CAAG,0BAA0B,YAAM;MACjCD,MAAA,CAAOE,WAAA,CAAY,WAAW,CAAC,EAAEG,IAAA,CAAK,WAAW;MACjDL,MAAA,CAAOE,WAAA,CAAY,SAAS,CAAC,EAAEG,IAAA,CAAK,SAAS;IAC/C,CAAC;IAEDJ,EAAA,CAAG,yBAAyB,YAAM;MAChC,IAAAK,IAAM,GAAAJ,WAAO,SAA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