Buckets:
37 GB
4,042,753 files
Updated about 1 month ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| src | 2 items | ||
| tests | 2 items | ||
| CHANGELOG.md | 2.24 kB xet | d8ce3dfc | |
| README.md | 3.54 kB xet | d70053f1 | |
| deno.json | 395 Bytes xet | 0c18926b | |
| mod.ts | 557 Bytes xet | 5a4fba2e |
@zuke/dpdm
Typed dpdm CLI task wrapper for Zuke builds — analyze a project's module dependency graph and report circular imports.
import { DpdmTasks } from "@zuke/dpdm";
// Fail the build on any circular dependency among the entry files.
await DpdmTasks.analyze((s) =>
s.noTree().noWarning().exitCode("circular:1").entries("src/index.ts")
);
Entry files are passed via .entries(...) and appended after every option, and
arguments stay a discrete argv array — so command construction is
injection-free.
API
Full typed API — generated from deno doc
`@zuke/dpdm` — a typed `DpdmTasks` wrapper for the
dpdm (https://github.com/acrazing/dpdm) CLI (module dependency graph and
circular-import analysis), for use in Zuke builds.
```ts
import { DpdmTasks } from "@zuke/dpdm";
await DpdmTasks.analyze((s) =>
s.noTree().noWarning().exitCode("circular:1").entries("src/index.ts")
);
```
@module
const DpdmTasks: DpdmTasksApi
Typed task functions for the `dpdm` CLI.
class DpdmAnalyzeSettings extends ToolSettings
Settings for a `dpdm` analysis run.
override protected defaultTool(): string
The command this settings object runs (`dpdm`).
override protected defaultResolution(): ToolResolution
Resolve the binary from `node_modules/.bin` by default — dpdm is an npm-distributed tool.
transform(): this
Transform TypeScript modules to JavaScript before analysis (`--transform`).
noTree(): this
Suppress the dependency tree output (`--no-tree`).
noCircular(): this
Suppress the circular-dependency output (`--no-circular`).
noWarning(): this
Suppress warnings about unresolved/missing modules (`--no-warning`).
noProgress(): this
Disable the progress bar (`--no-progress`).
output(path: PathLike): this
Write the analysis as JSON to a file (`--output`).
tsconfig(path: PathLike): this
Use an explicit tsconfig for module resolution (`--tsconfig`).
context(path: PathLike): this
Set the context directory used to shorten printed paths (`--context`).
extensions(...exts: string[]): this
Extensions to resolve, e.g. `.ts`, `.tsx` (`--extensions`).
js(...exts: string[]): this
Extensions treated as JavaScript-like (`--js`).
include(pattern: string): this
Only analyze files matching this regular expression (`--include`).
exclude(pattern: string): this
Skip files matching this regular expression (`--exclude`).
skipDynamicImports(mode: "circular" | "tree"): this
Skip dynamic imports when detecting `circular` or `tree` (`--skip-dynamic-imports`).
detectUnusedFilesFrom(glob: string): this
Detect unused files starting from this glob (`--detect-unused-files-from`).
exitCode(rule: string): this
Exit with a code when a case occurs, e.g. `circular:1` (`--exit-code`).
entries(...paths: PathLike[]): this
The entry files or globs to analyze (appended after all options).
override protected onOutput(output: CommandOutput): void
Report `Circular`, the cycles found, onto the build summary.
override protected buildArgs(): string[]
Assemble the `dpdm <flags> <entries...>` argv.
interface DpdmTasksApi
The shape of {@link DpdmTasks}.
analyze(configure?: Configure<DpdmAnalyzeSettings>): Promise<CommandOutput>
Analyze dependencies and circular imports: `dpdm <flags> <entries...>`.
- Total size
- 37 GB
- Files
- 4,042,753
- Last updated
- Oct 24
- Pre-warmed CDN
- US EU US EU