@vercel/cli-config 0.2.1 → 0.2.3
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/paths.js +5 -3
- package/package.json +6 -8
package/dist/paths.js
CHANGED
|
@@ -12,7 +12,6 @@ exports.readGlobalConfigFlag = readGlobalConfigFlag;
|
|
|
12
12
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
13
13
|
const node_path_1 = __importDefault(require("node:path"));
|
|
14
14
|
const node_os_1 = require("node:os");
|
|
15
|
-
const xdg_app_paths_1 = __importDefault(require("xdg-app-paths"));
|
|
16
15
|
function isReadableDirectory(targetPath) {
|
|
17
16
|
try {
|
|
18
17
|
return node_fs_1.default.lstatSync(targetPath).isDirectory();
|
|
@@ -22,11 +21,14 @@ function isReadableDirectory(targetPath) {
|
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
function getGlobalPathConfig() {
|
|
25
|
-
|
|
24
|
+
// xdg-app-paths infers a default app name when loaded, which requires a
|
|
25
|
+
// process entrypoint that is not present in every server runtime.
|
|
26
|
+
const XDGAppPaths = require('xdg-app-paths');
|
|
27
|
+
const vercelDirectories = XDGAppPaths('com.vercel.cli').dataDirs();
|
|
26
28
|
const possibleConfigPaths = [
|
|
27
29
|
...vercelDirectories, // latest vercel directory
|
|
28
30
|
node_path_1.default.join((0, node_os_1.homedir)(), '.now'), // legacy config in user's home directory
|
|
29
|
-
...(
|
|
31
|
+
...XDGAppPaths('now').dataDirs(), // legacy XDG directory
|
|
30
32
|
];
|
|
31
33
|
return (possibleConfigPaths.find(configPath => isReadableDirectory(configPath)) ||
|
|
32
34
|
vercelDirectories[0]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/cli-config",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Shared core utilities for Vercel global configuration",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://vercel.com/docs/projects/project-configuration/global-configuration",
|
|
@@ -26,19 +26,17 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "20.11.0",
|
|
28
28
|
"ts-to-zod": "^3",
|
|
29
|
-
"vite": "
|
|
30
|
-
"vitest": "
|
|
29
|
+
"vite": "6.4.3",
|
|
30
|
+
"vitest": "4.1.10"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "
|
|
36
|
+
"build": "tsc",
|
|
37
37
|
"generate:schemas": "ts-to-zod src/types.ts src/schema.zod.ts",
|
|
38
|
-
"test": "
|
|
39
|
-
"test-unit": "
|
|
40
|
-
"vitest-run": "vitest run -c ../../vitest.config.mts",
|
|
41
|
-
"vitest-unit": "glob --absolute 'test/*.test.ts'",
|
|
38
|
+
"test": "vitest run --config ../../vitest.config.mts test",
|
|
39
|
+
"test-unit": "vitest run --config ../../vitest.config.mts",
|
|
42
40
|
"type-check": "tsc --noEmit"
|
|
43
41
|
}
|
|
44
42
|
}
|