UNPKG

bob-the-bundler

Version:
19 lines (18 loc) 958 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWorkspacePackagePaths = void 0; const tslib_1 = require("tslib"); const globby_1 = tslib_1.__importDefault(require("globby")); const path_1 = tslib_1.__importDefault(require("path")); const constants_1 = require("../constants"); async function getWorkspacePackagePaths(cwd, workspaces) { const packageJSONPaths = await (0, globby_1.default)(workspaces /** We are only interested in workspaces that are packages (for now.) */ .filter((workspacePattern) => workspacePattern.startsWith("packages/")) .map((workspacePattern) => path_1.default.join(workspacePattern, "package.json")), { cwd, ignore: ["**/node_modules/**", ...constants_1.buildArtifactDirectories], }); return packageJSONPaths.map((packageJSONPath) => path_1.default.dirname(packageJSONPath)); } exports.getWorkspacePackagePaths = getWorkspacePackagePaths;