@dovenv/workspace
- API documentation โ
Classes โ
Workspace โ
Constructors โ
new Workspace() โ
ts
new Workspace(__namedParameters: {
opts: Config;
utils: CommandSuper;
}): Workspace
Parameters โ
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): Config
Workspace 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