@ms-cloudpack/path-utilities 2.7.56 → 2.8.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/lib/findProjectRoot.d.ts +12 -0
- package/lib/findProjectRoot.d.ts.map +1 -0
- package/lib/findProjectRoot.js +18 -0
- package/lib/findProjectRoot.js.map +1 -0
- package/lib/index.d.ts +9 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -5
- package/lib/index.js.map +1 -1
- package/lib/isExternalPackage.d.ts +6 -0
- package/lib/isExternalPackage.d.ts.map +1 -0
- package/lib/isExternalPackage.js +11 -0
- package/lib/isExternalPackage.js.map +1 -0
- package/lib/resolve.d.ts +8 -0
- package/lib/resolve.d.ts.map +1 -0
- package/lib/resolve.js +27 -0
- package/lib/resolve.js.map +1 -0
- package/lib/resolveModule.d.ts +9 -0
- package/lib/resolveModule.d.ts.map +1 -0
- package/lib/resolveModule.js +15 -0
- package/lib/resolveModule.js.map +1 -0
- package/package.json +8 -5
- package/lib/tsdoc-metadata.json +0 -11
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the project root:
|
|
3
|
+
* - Current workspace root (for multi-workspace monorepo)
|
|
4
|
+
* - Git root
|
|
5
|
+
* - Package root (unless `options.noPackageRoot` is true)
|
|
6
|
+
* - undefined if not found
|
|
7
|
+
*/
|
|
8
|
+
export declare function findProjectRoot(cwd: string, options?: {
|
|
9
|
+
/** Skip the package root fallback */
|
|
10
|
+
noPackageRoot?: boolean;
|
|
11
|
+
}): string | undefined;
|
|
12
|
+
//# sourceMappingURL=findProjectRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findProjectRoot.d.ts","sourceRoot":"","sources":["../src/findProjectRoot.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IACP,qCAAqC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;CACpB,GACL,MAAM,GAAG,SAAS,CAMpB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- this is the definition of the wrapper
|
|
2
|
+
import { findProjectRoot as wsToolsFindProjectRoot, findPackageRoot } from 'workspace-tools';
|
|
3
|
+
/**
|
|
4
|
+
* Find the project root:
|
|
5
|
+
* - Current workspace root (for multi-workspace monorepo)
|
|
6
|
+
* - Git root
|
|
7
|
+
* - Package root (unless `options.noPackageRoot` is true)
|
|
8
|
+
* - undefined if not found
|
|
9
|
+
*/
|
|
10
|
+
export function findProjectRoot(cwd, options = {}) {
|
|
11
|
+
try {
|
|
12
|
+
return wsToolsFindProjectRoot(cwd);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return options.noPackageRoot ? undefined : findPackageRoot(cwd);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=findProjectRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findProjectRoot.js","sourceRoot":"","sources":["../src/findProjectRoot.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,UAGI,EAAE;IAEN,IAAI,CAAC;QACH,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;AACH,CAAC","sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- this is the definition of the wrapper\nimport { findProjectRoot as wsToolsFindProjectRoot, findPackageRoot } from 'workspace-tools';\n\n/**\n * Find the project root:\n * - Current workspace root (for multi-workspace monorepo)\n * - Git root\n * - Package root (unless `options.noPackageRoot` is true)\n * - undefined if not found\n */\nexport function findProjectRoot(\n cwd: string,\n options: {\n /** Skip the package root fallback */\n noPackageRoot?: boolean;\n } = {},\n): string | undefined {\n try {\n return wsToolsFindProjectRoot(cwd);\n } catch {\n return options.noPackageRoot ? undefined : findPackageRoot(cwd);\n }\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
export { findPackageRoot } from './findPackageRoot.js';
|
|
1
2
|
export { formatLocation } from './formatLocation.js';
|
|
2
3
|
export { globSourceFiles } from './globSourceFiles.js';
|
|
3
4
|
export { intermediateToSourcePath } from './intermediateToSourcePath.js';
|
|
4
|
-
export { isFileSync } from './isFileSync.js';
|
|
5
5
|
export { isFile } from './isFile.js';
|
|
6
|
-
export {
|
|
6
|
+
export { isFileSync } from './isFileSync.js';
|
|
7
7
|
export { isFolder } from './isFolder.js';
|
|
8
|
+
export { isFolderSync } from './isFolderSync.js';
|
|
8
9
|
export { normalizedPathRelativeTo } from './normalizedPathRelativeTo.js';
|
|
9
|
-
export { typescriptExtensions, javascriptExtensions, sourceExtensions } from './sourceExtensions.js';
|
|
10
|
-
export { sourceToIntermediatePath } from './sourceToIntermediatePath.js';
|
|
11
|
-
export { findPackageRoot } from './findPackageRoot.js';
|
|
12
10
|
export { pathSymbolReplacement } from './pathSymbolReplacement.js';
|
|
11
|
+
export { javascriptExtensions, sourceExtensions, typescriptExtensions } from './sourceExtensions.js';
|
|
12
|
+
export { sourceToIntermediatePath } from './sourceToIntermediatePath.js';
|
|
13
|
+
export { findProjectRoot } from './findProjectRoot.js';
|
|
14
|
+
export { isExternalPackage } from './isExternalPackage.js';
|
|
15
|
+
export { resolve } from './resolve.js';
|
|
16
|
+
export { resolveModule } from './resolveModule.js';
|
|
13
17
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
export { findPackageRoot } from './findPackageRoot.js';
|
|
1
2
|
export { formatLocation } from './formatLocation.js';
|
|
2
3
|
export { globSourceFiles } from './globSourceFiles.js';
|
|
3
4
|
export { intermediateToSourcePath } from './intermediateToSourcePath.js';
|
|
4
|
-
export { isFileSync } from './isFileSync.js';
|
|
5
5
|
export { isFile } from './isFile.js';
|
|
6
|
-
export {
|
|
6
|
+
export { isFileSync } from './isFileSync.js';
|
|
7
7
|
export { isFolder } from './isFolder.js';
|
|
8
|
+
export { isFolderSync } from './isFolderSync.js';
|
|
8
9
|
export { normalizedPathRelativeTo } from './normalizedPathRelativeTo.js';
|
|
9
|
-
export { typescriptExtensions, javascriptExtensions, sourceExtensions } from './sourceExtensions.js';
|
|
10
|
-
export { sourceToIntermediatePath } from './sourceToIntermediatePath.js';
|
|
11
|
-
export { findPackageRoot } from './findPackageRoot.js';
|
|
12
10
|
export { pathSymbolReplacement } from './pathSymbolReplacement.js';
|
|
11
|
+
export { javascriptExtensions, sourceExtensions, typescriptExtensions } from './sourceExtensions.js';
|
|
12
|
+
export { sourceToIntermediatePath } from './sourceToIntermediatePath.js';
|
|
13
|
+
export { findProjectRoot } from './findProjectRoot.js';
|
|
14
|
+
export { isExternalPackage } from './isExternalPackage.js';
|
|
15
|
+
export { resolve } from './resolve.js';
|
|
16
|
+
export { resolveModule } from './resolveModule.js';
|
|
13
17
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { findPackageRoot } from './findPackageRoot.js';\nexport { formatLocation } from './formatLocation.js';\nexport { globSourceFiles } from './globSourceFiles.js';\nexport { intermediateToSourcePath } from './intermediateToSourcePath.js';\nexport { isFile } from './isFile.js';\nexport { isFileSync } from './isFileSync.js';\nexport { isFolder } from './isFolder.js';\nexport { isFolderSync } from './isFolderSync.js';\nexport { normalizedPathRelativeTo } from './normalizedPathRelativeTo.js';\nexport { pathSymbolReplacement } from './pathSymbolReplacement.js';\nexport { javascriptExtensions, sourceExtensions, typescriptExtensions } from './sourceExtensions.js';\nexport { sourceToIntermediatePath } from './sourceToIntermediatePath.js';\nexport { findProjectRoot } from './findProjectRoot.js';\nexport { isExternalPackage } from './isExternalPackage.js';\nexport { resolve } from './resolve.js';\nexport { resolveModule } from './resolveModule.js';\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether the package is external, based on whether the given path contains a
|
|
3
|
+
* `node_modules` segment (without any realpath checks).
|
|
4
|
+
*/
|
|
5
|
+
export declare function isExternalPackage(packagePath: string): boolean;
|
|
6
|
+
//# sourceMappingURL=isExternalPackage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isExternalPackage.d.ts","sourceRoot":"","sources":["../src/isExternalPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAM9D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether the package is external, based on whether the given path contains a
|
|
3
|
+
* `node_modules` segment (without any realpath checks).
|
|
4
|
+
*/
|
|
5
|
+
export function isExternalPackage(packagePath) {
|
|
6
|
+
if (packagePath) {
|
|
7
|
+
return /[\\/]node_modules[\\/]/.test(packagePath);
|
|
8
|
+
}
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=isExternalPackage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isExternalPackage.js","sourceRoot":"","sources":["../src/isExternalPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * Returns whether the package is external, based on whether the given path contains a\n * `node_modules` segment (without any realpath checks).\n */\nexport function isExternalPackage(packagePath: string): boolean {\n if (packagePath) {\n return /[\\\\/]node_modules[\\\\/]/.test(packagePath);\n }\n\n return false;\n}\n"]}
|
package/lib/resolve.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a package path given the parent path.
|
|
3
|
+
* @param packageName - The package name.
|
|
4
|
+
* @param parentPath - The parent path.
|
|
5
|
+
* @returns The resolved absolute package path.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolve(packageName: string, parentPath: string): Promise<string | undefined>;
|
|
8
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgBlG"}
|
package/lib/resolve.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import resolvePackage from 'resolve';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a package path given the parent path.
|
|
5
|
+
* @param packageName - The package name.
|
|
6
|
+
* @param parentPath - The parent path.
|
|
7
|
+
* @returns The resolved absolute package path.
|
|
8
|
+
*/
|
|
9
|
+
export async function resolve(packageName, parentPath) {
|
|
10
|
+
const packageRootImport = path.join(packageName, 'package.json');
|
|
11
|
+
return new Promise((success) => {
|
|
12
|
+
try {
|
|
13
|
+
resolvePackage(packageRootImport, { basedir: parentPath, preserveSymlinks: false }, (err, resolvedPath) => {
|
|
14
|
+
if (err || !resolvedPath) {
|
|
15
|
+
success(undefined);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
success(path.dirname(resolvedPath));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
success(undefined);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,WAAmB,EAAE,UAAkB;IACnE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAEjE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,CAAC;YACH,cAAc,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE;gBACxG,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;oBACzB,OAAO,CAAC,SAAS,CAAC,CAAC;gBACrB,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import path from 'path';\nimport resolvePackage from 'resolve';\n\n/**\n * Resolves a package path given the parent path.\n * @param packageName - The package name.\n * @param parentPath - The parent path.\n * @returns The resolved absolute package path.\n */\nexport async function resolve(packageName: string, parentPath: string): Promise<string | undefined> {\n const packageRootImport = path.join(packageName, 'package.json');\n\n return new Promise((success) => {\n try {\n resolvePackage(packageRootImport, { basedir: parentPath, preserveSymlinks: false }, (err, resolvedPath) => {\n if (err || !resolvedPath) {\n success(undefined);\n } else {\n success(path.dirname(resolvedPath));\n }\n });\n } catch (e) {\n success(undefined);\n }\n });\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
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
|
+
*/
|
|
5
|
+
export declare function resolveModule(params: {
|
|
6
|
+
importSpecifier: string;
|
|
7
|
+
parentUrl: string;
|
|
8
|
+
}): string;
|
|
9
|
+
//# sourceMappingURL=resolveModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveModule.d.ts","sourceRoot":"","sources":["../src/resolveModule.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAK5F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { moduleResolve } from 'import-meta-resolve';
|
|
2
|
+
import { pathToFileURL } from 'url';
|
|
3
|
+
// Conditions used for resolution if the package has an exports map.
|
|
4
|
+
// More could be added later if desired ("default" is implicitly included).
|
|
5
|
+
const conditions = new Set(['import', 'require', 'node']);
|
|
6
|
+
/**
|
|
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
|
+
*/
|
|
10
|
+
export function resolveModule(params) {
|
|
11
|
+
const { importSpecifier, parentUrl } = params;
|
|
12
|
+
const resolvedUrl = moduleResolve(importSpecifier, pathToFileURL(parentUrl), conditions);
|
|
13
|
+
return resolvedUrl.toString();
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=resolveModule.js.map
|
|
@@ -0,0 +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,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"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/path-utilities",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.8.0",
|
|
4
|
+
"description": "Path utilities for Cloudpack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
@@ -24,11 +24,14 @@
|
|
|
24
24
|
"test": "cloudpack-scripts test"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ms-cloudpack/path-string-parsing": "^1.2.
|
|
28
|
-
"fast-glob": "^3.2.12"
|
|
27
|
+
"@ms-cloudpack/path-string-parsing": "^1.2.6",
|
|
28
|
+
"fast-glob": "^3.2.12",
|
|
29
|
+
"import-meta-resolve": "^4.0.0",
|
|
30
|
+
"resolve": "^1.22.0",
|
|
31
|
+
"workspace-tools": "^0.38.0"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"@ms-cloudpack/common-types": "^0.23.
|
|
34
|
+
"@ms-cloudpack/common-types": "^0.23.7",
|
|
32
35
|
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|
|
33
36
|
"@ms-cloudpack/scripts": "^0.0.1",
|
|
34
37
|
"@ms-cloudpack/test-utilities": "^0.5.0"
|
package/lib/tsdoc-metadata.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.47.11"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|