@storm-software/projen
Version:
Tools for managing Projen configuration automation within a Nx workspace.
113 lines (110 loc) • 3.52 kB
text/typescript
import { NxWorkspace } from '@aws/pdk/monorepo/components/nx-workspace';
import { Nx } from '@aws/pdk/monorepo/nx-types';
import { NxJsonConfiguration } from '@nx/devkit';
import { Project, JsonFile } from 'projen';
import { Obj } from 'projen/lib/util';
/**
* Default NX outputs to cache
*/
declare const NX_DEFAULT_BUILD_OUTPUTS: string[];
/**
* Component which manages the workspace specific NX Config for the root monorepo.
*/
declare class StormNxWorkspace extends NxWorkspace {
/**
* Retrieves the singleton instance associated with project root.
*
* @param scope project instance.
*/
static of(scope: Project): NxWorkspace | undefined;
/**
* Raw nx.json file to support overrides that aren't handled
* directly.
*
* **Attention:** any overrides applied here will not be visible
* in the properties and only included in final synthesized output,
* and likely to override native handling.
* @advanced
*/
readonly nxJson: JsonFile;
/**
* Automatically infer NxProject targets based on project type.
* @experimental
*/
autoInferProjectTargets: boolean;
/**
* List of cacheable operations.
*/
cacheableOperations: string[];
/**
* Some presets use the extends property to hide some default options in a separate json file.
* The json file specified in the extends property is located in your node_modules folder.
* The Nx preset files are specified in the nx package.
*
* @default "@storm-software/workspace-tools/config/base.json"
*/
extends: string;
/**
* Plugins for extending the project graph
*/
nxPlugins: NxJsonConfiguration["plugins"];
/**
* Default options for `nx affected`
*/
affected: Nx.INxAffectedConfig;
/**
* Named inputs
* @see https://nx.dev/reference/nx-json#inputs-&-namedinputs
*/
namedInputs: Nx.INamedInputs;
/**
* Dependencies between different target names across all projects
*
* @see https://nx.dev/reference/nx-json#target-defaults
*/
targetDefaults: Nx.ITargetDefaults;
/**
* Configuration for Nx releases
*/
release: Obj<any>;
/**
* The number of parallel tasks to run.
*
* @defaultValue 5
*/
parallel: number;
/**
* Should the daemon be used to run tasks?
*
* @defaultValue true
*/
useDaemonProcess: boolean;
/**
* Set this to false to disable adding inference plugins when generating new projects
*
* @defaultValue true
*/
useInferencePlugins: boolean;
/**
* The default base branch for new projects.
*
* @defaultValue "main"
*/
defaultBase: string;
/**
* The CLI configuration for the workspace.
*/
cli: NxJsonConfiguration["cli"] | undefined;
constructor(project: Project);
/**
* Adds a release group to the workspace.
*
* @param name The name of the release group
* @param projects The projects in the release group
* @param projectsRelationship The relationship between the projects
* @param releaseTagPattern The release tag pattern
* @param groupPreVersionCommand The command to run before versioning
*/
addReleaseGroup(name: string, projects: string[] | string, projectsRelationship?: "fixed" | "independent", releaseTagPattern?: string, groupPreVersionCommand?: string): void;
}
export { NX_DEFAULT_BUILD_OUTPUTS, StormNxWorkspace };