UNPKG

@storm-software/workspace-tools

Version:

Tools for managing a Storm workspace, including various Nx generators and executors for common development tasks.

137 lines (134 loc) 3.47 kB
import { Tree } from '@nx/devkit'; interface CargoToml { workspace?: { members: string[]; }; package: any; dependencies?: Record<string, string | { version: string; features?: string[]; optional?: boolean; }>; "dev-dependencies"?: Record<string, string | { version: string; features: string[]; }>; [key: string]: any; } interface CargoMetadata { packages: Package[]; workspace_members: string[]; resolve: Resolve; target_directory: string; version: number; workspace_root: string; metadata: Metadata2; } interface Package { name: string; version: string; id: string; license: string; license_file: string; description: string; source: any; dependencies: Dependency[]; targets: Target[]; features: Features; manifest_path: string; metadata: Metadata; /** * From the docs: * "List of registries to which this package may be published. * Publishing is unrestricted if null, and forbidden if an empty array." * * Additional observation: * false can be used by the end user but it will be converted to an empty * array in the cargo metadata output. */ publish?: string[] | boolean | null; authors: string[]; categories: string[]; default_run: any; rust_version: string; keywords: string[]; readme: string; repository: string; homepage: string; documentation: string; edition: string; links: any; } interface Dependency { name: string; source: string; req: string; kind: any; rename: any; optional: boolean; uses_default_features: boolean; features: any[]; target: string; path: string; registry: any; workspace: boolean; } interface Target { kind: string[]; crate_types: string[]; name: string; src_path: string; edition: string; "required-features": string[]; doc: boolean; doctest: boolean; test: boolean; } interface Features { default: string[]; feat1: any[]; feat2: any[]; } interface Metadata { docs: Docs; } interface Docs { rs: Rs; } interface Rs { "all-features": boolean; } interface Resolve { nodes: Node[]; root: string; } interface Node { id: string; dependencies: string[]; deps: Dep[]; features: string[]; } interface Dep { name: string; pkg: string; dep_kinds: DepKind[]; } interface DepKind { kind: any; target: string; } interface Metadata2 { docs: Docs2; } interface Docs2 { rs: Rs2; } interface Rs2 { "all-features": boolean; } declare function parseCargoTomlWithTree(tree: Tree, projectRoot: string, projectName: string): CargoToml; declare function parseCargoToml(cargoString?: string): CargoToml; declare function stringifyCargoToml(cargoToml: CargoToml): string; declare function modifyCargoTable(toml: CargoToml, section: string, key: string, value: string | object | any[] | (() => any)): void; declare function modifyCargoNestedTable(toml: CargoToml, section: string, key: string, value: object): void; export { type CargoMetadata, type CargoToml, type Dep, type DepKind, type Dependency, type Docs, type Docs2, type Features, type Metadata, type Metadata2, type Node, type Package, type Resolve, type Rs, type Rs2, type Target, modifyCargoNestedTable, modifyCargoTable, parseCargoToml, parseCargoTomlWithTree, stringifyCargoToml };