@ms-cloudpack/config 0.28.3 → 0.28.5

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Resolve a module specifier to a file path. Throws if it can't be resolved.
3
- * @returns - The resolved file path
2
+ * Resolve a module specifier to a file url (with protocol ie: file:). Throws if it can't be resolved.
3
+ * @returns - The resolved file url as a string.
4
4
  */
5
5
  export declare function resolveModule(params: {
6
6
  importSpecifier: string;
@@ -1,15 +1,15 @@
1
1
  import { moduleResolve } from 'import-meta-resolve';
2
- import { pathToFileURL, fileURLToPath } from 'url';
2
+ import { pathToFileURL } from 'url';
3
3
  // Conditions used for resolution if the package has an exports map.
4
4
  // More could be added later if desired ("default" is implicitly included).
5
5
  const conditions = new Set(['import', 'require', 'node']);
6
6
  /**
7
- * Resolve a module specifier to a file path. Throws if it can't be resolved.
8
- * @returns - The resolved file path
7
+ * Resolve a module specifier to a file url (with protocol ie: file:). Throws if it can't be resolved.
8
+ * @returns - The resolved file url as a string.
9
9
  */
10
10
  export function resolveModule(params) {
11
11
  const { importSpecifier, parentUrl } = params;
12
12
  const resolvedUrl = moduleResolve(importSpecifier, pathToFileURL(parentUrl), conditions);
13
- return fileURLToPath(resolvedUrl);
13
+ return resolvedUrl.toString();
14
14
  }
15
15
  //# sourceMappingURL=resolveModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveModule.js","sourceRoot":"","sources":["../src/resolveModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEnD,oEAAoE;AACpE,2EAA2E;AAC3E,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAsD;IAClF,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAE9C,MAAM,WAAW,GAAG,aAAa,CAAC,eAAe,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACzF,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { moduleResolve } from 'import-meta-resolve';\nimport { pathToFileURL, fileURLToPath } from 'url';\n\n// Conditions used for resolution if the package has an exports map.\n// More could be added later if desired (\"default\" is implicitly included).\nconst conditions = new Set(['import', 'require', 'node']);\n\n/**\n * Resolve a module specifier to a file path. Throws if it can't be resolved.\n * @returns - The resolved file path\n */\nexport function resolveModule(params: { importSpecifier: string; parentUrl: string }): string {\n const { importSpecifier, parentUrl } = params;\n\n const resolvedUrl = moduleResolve(importSpecifier, pathToFileURL(parentUrl), conditions);\n return fileURLToPath(resolvedUrl);\n}\n"]}
1
+ {"version":3,"file":"resolveModule.js","sourceRoot":"","sources":["../src/resolveModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,oEAAoE;AACpE,2EAA2E;AAC3E,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAsD;IAClF,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAE9C,MAAM,WAAW,GAAG,aAAa,CAAC,eAAe,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACzF,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import { moduleResolve } from 'import-meta-resolve';\nimport { pathToFileURL } from 'url';\n\n// Conditions used for resolution if the package has an exports map.\n// More could be added later if desired (\"default\" is implicitly included).\nconst conditions = new Set(['import', 'require', 'node']);\n\n/**\n * Resolve a module specifier to a file url (with protocol ie: file:). Throws if it can't be resolved.\n * @returns - The resolved file url as a string.\n */\nexport function resolveModule(params: { importSpecifier: string; parentUrl: string }): string {\n const { importSpecifier, parentUrl } = params;\n\n const resolvedUrl = moduleResolve(importSpecifier, pathToFileURL(parentUrl), conditions);\n return resolvedUrl.toString();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveParentConfig.d.ts","sourceRoot":"","sources":["../src/resolveParentConfig.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,GAAG,SAAS,CAUrB"}
1
+ {"version":3,"file":"resolveParentConfig.d.ts","sourceRoot":"","sources":["../src/resolveParentConfig.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,GAAG,SAAS,CAUrB"}
@@ -1,3 +1,4 @@
1
+ import { fileURLToPath } from 'url';
1
2
  import { resolveModule } from './resolveModule.js';
2
3
  /**
3
4
  * Resolve an import specifier for a parent config file.
@@ -6,7 +7,7 @@ import { resolveModule } from './resolveModule.js';
6
7
  export function resolveParentConfig(params) {
7
8
  const { importSpecifier } = params;
8
9
  try {
9
- return resolveModule({ importSpecifier, parentUrl: params.configPath });
10
+ return fileURLToPath(resolveModule({ importSpecifier, parentUrl: params.configPath }));
10
11
  }
11
12
  catch (err) {
12
13
  console.warn(`Error resolving config "extends": "${importSpecifier}": ${err.message || err}`);
@@ -1 +1 @@
1
- {"version":3,"file":"resolveParentConfig.js","sourceRoot":"","sources":["../src/resolveParentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAKnC;IACC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAEnC,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC1E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,sCAAsC,eAAe,MAAO,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { resolveModule } from './resolveModule.js';\n\n/**\n * Resolve an import specifier for a parent config file.\n * Returns undefined if it can't be resolved or doesn't exist.\n */\nexport function resolveParentConfig(params: {\n /** Path of the config file being processed. */\n configPath: string;\n /** The import specifier for the parent (extends) config file. */\n importSpecifier: string;\n}): string | undefined {\n const { importSpecifier } = params;\n\n try {\n return resolveModule({ importSpecifier, parentUrl: params.configPath });\n } catch (err) {\n console.warn(`Error resolving config \"extends\": \"${importSpecifier}\": ${(err as Error).message || err}`);\n }\n\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"resolveParentConfig.js","sourceRoot":"","sources":["../src/resolveParentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAKnC;IACC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAEnC,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,aAAa,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACzF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,sCAAsC,eAAe,MAAO,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { fileURLToPath } from 'url';\nimport { resolveModule } from './resolveModule.js';\n\n/**\n * Resolve an import specifier for a parent config file.\n * Returns undefined if it can't be resolved or doesn't exist.\n */\nexport function resolveParentConfig(params: {\n /** Path of the config file being processed. */\n configPath: string;\n /** The import specifier for the parent (extends) config file. */\n importSpecifier: string;\n}): string | undefined {\n const { importSpecifier } = params;\n\n try {\n return fileURLToPath(resolveModule({ importSpecifier, parentUrl: params.configPath }));\n } catch (err) {\n console.warn(`Error resolving config \"extends\": \"${importSpecifier}\": ${(err as Error).message || err}`);\n }\n\n return undefined;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/config",
3
- "version": "0.28.3",
3
+ "version": "0.28.5",
4
4
  "description": "Configuration handling for cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,11 +14,11 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@ms-cloudpack/common-types": "^0.19.3",
17
+ "@ms-cloudpack/common-types": "^0.19.4",
18
18
  "@ms-cloudpack/json-utilities": "^0.1.7",
19
- "@ms-cloudpack/package-utilities": "^10.0.3",
19
+ "@ms-cloudpack/package-utilities": "^10.0.4",
20
20
  "@ms-cloudpack/path-string-parsing": "^1.2.4",
21
- "@ms-cloudpack/path-utilities": "^2.7.40",
21
+ "@ms-cloudpack/path-utilities": "^2.7.41",
22
22
  "import-meta-resolve": "^4.0.0",
23
23
  "semver": "^7.6.0"
24
24
  },