@ms-cloudpack/config 0.38.34 → 0.38.36
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.
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @param overridePath If set, this path (probably from a CLI option) will be used instead
|
|
8
8
|
* of the path from preferences.
|
|
9
|
+
* @returns An absolute path to the cache directory. Relative paths are resolved against cwd.
|
|
9
10
|
*/
|
|
10
11
|
export declare function getCachePath(overridePath?: string): Promise<string>;
|
|
11
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCachePath.d.ts","sourceRoot":"","sources":["../../src/userPreferences/getCachePath.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"getCachePath.d.ts","sourceRoot":"","sources":["../../src/userPreferences/getCachePath.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAIzE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -9,9 +9,12 @@ import { readUserPreferences } from './readUserPreferences.js';
|
|
|
9
9
|
*
|
|
10
10
|
* @param overridePath If set, this path (probably from a CLI option) will be used instead
|
|
11
11
|
* of the path from preferences.
|
|
12
|
+
* @returns An absolute path to the cache directory. Relative paths are resolved against cwd.
|
|
12
13
|
*/
|
|
13
14
|
export async function getCachePath(overridePath) {
|
|
14
|
-
|
|
15
|
+
const cachePath = overridePath || (await readUserPreferences())?.cachePath || path.join(os.homedir(), '.cloudpack');
|
|
16
|
+
// Always resolve to absolute path for consistent behavior across all consumers
|
|
17
|
+
return path.resolve(cachePath);
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* Gets the path to the app's local cache directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCachePath.js","sourceRoot":"","sources":["../../src/userPreferences/getCachePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"getCachePath.js","sourceRoot":"","sources":["../../src/userPreferences/getCachePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,YAAqB;IACtD,MAAM,SAAS,GAAG,YAAY,IAAI,CAAC,MAAM,mBAAmB,EAAE,CAAC,EAAE,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;IACpH,+EAA+E;IAC/E,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import os from 'os';\nimport path from 'path';\nimport { readUserPreferences } from './readUserPreferences.js';\n\n/**\n * Get the cache path from user preferences if set.\n * Falls back to the default cache path `~/.cloudpack`.\n *\n * NOTE: If a session object is available, you should use `session.cachePath` instead.\n *\n * @param overridePath If set, this path (probably from a CLI option) will be used instead\n * of the path from preferences.\n * @returns An absolute path to the cache directory. Relative paths are resolved against cwd.\n */\nexport async function getCachePath(overridePath?: string): Promise<string> {\n const cachePath = overridePath || (await readUserPreferences())?.cachePath || path.join(os.homedir(), '.cloudpack');\n // Always resolve to absolute path for consistent behavior across all consumers\n return path.resolve(cachePath);\n}\n\n/**\n * Gets the path to the app's local cache directory.\n */\nexport function getLocalCachePath(appPath: string): string {\n return path.join(appPath, 'node_modules', '.cache', 'cloudpack');\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/config",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.36",
|
|
4
4
|
"description": "Configuration handling for Cloudpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"test": "cloudpack-scripts test"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ms-cloudpack/common-types": "^0.33.
|
|
27
|
+
"@ms-cloudpack/common-types": "^0.33.3",
|
|
28
28
|
"@ms-cloudpack/environment": "^0.1.1",
|
|
29
29
|
"@ms-cloudpack/json-utilities": "^0.1.11",
|
|
30
|
-
"@ms-cloudpack/package-utilities": "^13.7.
|
|
30
|
+
"@ms-cloudpack/package-utilities": "^13.7.2",
|
|
31
31
|
"@ms-cloudpack/path-string-parsing": "^1.3.0",
|
|
32
|
-
"@ms-cloudpack/path-utilities": "^3.2.
|
|
32
|
+
"@ms-cloudpack/path-utilities": "^3.2.9",
|
|
33
33
|
"semver": "^7.6.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|