@dovenv/workspace - API documentation β
Classes β
Workspace β
Constructors β
new Workspace() β
ts
new Workspace(__namedParameters: {
opts: Config;
utils: CommandSuper;
}): WorkspaceParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | Config |
__namedParameters.utils | CommandSuper |
Returns β
Methods β
audit() β
ts
audit(fix?: boolean): Promise<void>Parameters β
| Parameter | Type |
|---|---|
fix? | boolean |
Returns β
Promise<void>
check() β
ts
check(): Promise<void>Returns β
Promise<void>
donate() β
ts
donate(open: boolean): Promise<void>Parameters β
| Parameter | Type | Default value |
|---|---|---|
open | boolean | true |
Returns β
Promise<void>
getPkgPaths() β
ts
getPkgPaths(): Promise<any>Returns β
Promise<any>
info() β
ts
info(): Promise<void>Returns β
Promise<void>
instructions() β
ts
instructions(): Promise<void>Returns β
Promise<void>
outdated() β
ts
outdated(): Promise<void>Returns β
Promise<void>
reinstall() β
ts
reinstall(): Promise<void>Returns β
Promise<void>
scripts() β
ts
scripts(opts?: string[]): Promise<void>Parameters β
| Parameter | Type |
|---|---|
opts? | string[] |
Returns β
Promise<void>
size() β
ts
size(): Promise<void>Returns β
Promise<void>
structure() β
ts
structure(): Promise<void>Returns β
Promise<void>
usefulCmds() β
ts
usefulCmds(): Promise<void>Returns β
Promise<void>
Properties β
| Property | Type |
|---|---|
opts | undefined | Config |
Functions β
workspacePlugin() β
ts
function workspacePlugin(params?: Config): ConfigWorkspace plugin for Dovenv.
Parameters β
| Parameter | Type | Description |
|---|---|---|
params? | Config | Plugin config. |
Returns β
Config
- A config with commands for workspace.
Example β
ts
import { defineConfig } from '@dovenv/core'
import { workspacePlugin } from '@dovenv/workspace'
export default defineConfig( workspacePlugin() )Type Aliases β
Config β
ts
type Config: {
check: {
pkg: Record<string, Prettify<Sharedcheck & {
schema: (opts: {
content: PackageJSON;
path: string;
utils: CommandUtils;
v: Validate;
}) => Promise<ValidateAnyType | void> | ValidateAnyType | void;
}>>;
};
custom: NonNullable<CommandUtils["config"]>["custom"];
info: {
instructions: string;
structure: Parameters<typeof setDirTree>[0]["structure"];
usefulCmds: {
cmd: string;
desc: string;
info: string;
}[];
};
reinstall: {
hook: {
after: () => Promise<void>;
before: () => Promise<void>;
};
};
};Type declaration β
| Name | Type | Description |
|---|---|---|
check? | { pkg: Record<string, Prettify<Sharedcheck & { schema: (opts: { content: PackageJSON; path: string; utils: CommandUtils; v: Validate; }) => Promise<ValidateAnyType | void> | ValidateAnyType | void; }>>; } | - |
check.pkg? | Record<string, Prettify<Sharedcheck & { schema: (opts: { content: PackageJSON; path: string; utils: CommandUtils; v: Validate; }) => Promise<ValidateAnyType | void> | ValidateAnyType | void; }>> | Checks for workspace package(s). |
custom? | NonNullable<CommandUtils["config"]>["custom"] | Custom configration for ws |
info? | { instructions: string; structure: Parameters<typeof setDirTree>[0]["structure"]; usefulCmds: { cmd: string; desc: string; info: string; }[]; } | Information for the workspace. |
info.instructions? | string | Instructions for the workspace. Must be markdown format. Accepts string, URL or path. Example ## Pre-requisites project needs the following tools to work: - node> 20 installed -pnpm> 9 installed -gh> 2 installed -git > 2 installed ## Init workspace pnpm install |
info.structure? | Parameters<typeof setDirTree>[0]["structure"] | Structure of the workspace. |
info.usefulCmds? | { cmd: string; desc: string; info: string; }[] | Add more commands to the list of useful commands. Example usefullCmds : [ { desc : 'Checks for outdated packages.', cmd : 'pnpm -r outdated', }, ] |
reinstall? | { hook: { after: () => Promise<void>; before: () => Promise<void>; }; } | Reinstall the workspace options |
reinstall.hook? | { after: () => Promise<void>; before: () => Promise<void>; } | - |
reinstall.hook.after? | () => Promise<void> | Hook after reinstallation |
reinstall.hook.before? | () => Promise<void> | Hook before reinstallation |
References β
default β
Renames and re-exports workspacePlugin
