@nx/devkit
Advanced tools
Comparing version 0.0.0-pr-29860-43e1fcb to 0.0.0-pr-29860-74361a9
{ | ||
"name": "@nx/devkit", | ||
"version": "0.0.0-pr-29860-43e1fcb", | ||
"version": "0.0.0-pr-29860-74361a9", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more. Learn more about [extending Nx by leveraging the Nx Devkit](https://nx.dev/extending-nx/intro/getting-started) on our docs.", |
import { CreateNodesContext, CreateNodesContextV2 } from 'nx/src/devkit-exports'; | ||
export declare function calculateHashForCreateNodes(projectRoot: string, options: object, context: CreateNodesContext | CreateNodesContextV2, additionalGlobs?: string[]): Promise<string>; | ||
export declare function calculateHashesForCreateNodes(projectRoots: string[], options: object, context: CreateNodesContext | CreateNodesContextV2, additionalGlobs?: string[][]): Promise<string[]>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.calculateHashForCreateNodes = calculateHashForCreateNodes; | ||
exports.calculateHashesForCreateNodes = calculateHashesForCreateNodes; | ||
const path_1 = require("path"); | ||
@@ -16,1 +17,13 @@ const devkit_exports_1 = require("nx/src/devkit-exports"); | ||
} | ||
async function calculateHashesForCreateNodes(projectRoots, options, context, additionalGlobs = []) { | ||
if (additionalGlobs.length && | ||
additionalGlobs.length !== projectRoots.length) { | ||
throw new Error('If additionalGlobs is provided, it must be the same length as projectRoots'); | ||
} | ||
return (0, devkit_internals_1.hashMultiGlobWithWorkspaceContext)(context.workspaceRoot, projectRoots.map((projectRoot, idx) => [ | ||
(0, path_1.join)(projectRoot, '**/*'), | ||
...(additionalGlobs.length ? additionalGlobs[idx] : []), | ||
])).then((hashes) => { | ||
return hashes.map((hash) => (0, devkit_exports_1.hashArray)([hash, (0, devkit_internals_1.hashObject)(options)])); | ||
}); | ||
} |
209768
5157