@nx/devkit
Advanced tools
Comparing version 0.0.0-pr-29464-a8559fe to 0.0.0-pr-29464-c4b160c
{ | ||
"name": "@nx/devkit", | ||
"version": "0.0.0-pr-29464-a8559fe", | ||
"version": "0.0.0-pr-29464-c4b160c", | ||
"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.", |
@@ -29,5 +29,5 @@ "use strict"; | ||
(0, devkit_exports_1.updateJson)(tree, updateConfigPath, (json) => { | ||
json.include = uniq([...json.include, 'src/**/*.js']); | ||
json.include = uniq([...(json.include ?? []), 'src/**/*.js']); | ||
json.exclude = uniq([ | ||
...json.exclude, | ||
...(json.exclude ?? []), | ||
'src/**/*.spec.js', | ||
@@ -34,0 +34,0 @@ 'src/**/*.test.js', |
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)])); | ||
}); | ||
} |
209784
5157