Gathering detailed insights and metrics for @reliverse/cfg
Gathering detailed insights and metrics for @reliverse/cfg
Gathering detailed insights and metrics for @reliverse/cfg
Gathering detailed insights and metrics for @reliverse/cfg
🧬 dler (prev. relidler) (/ˈdiː.lər/, dealer) is a flexible, unified, and fully automated bundler for typescript/javascript projects that doubles as an npm/jsr publishing tool. beyond bundling, dler serves as a comprehensive codemod toolkit for modern ts/js development.
npm install @reliverse/cfg
Typescript
Module System
Node Version
NPM Version
TypeScript (99.8%)
JavaScript (0.2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
65 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Jul 02, 2025
Latest Version
1.7.60
Package Id
@reliverse/cfg@1.7.60
Unpacked Size
196.62 kB
Size
47.77 kB
File Count
54
NPM Version
10.8.3
Node Version
22.6.0
Published on
Jul 02, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
48
sponsor — discord — github — npm
@reliverse/dler (
/ˈdiː.lər/
, dealer) is a flexible, unified, and fully automated bundler for typescript/javascript projects that doubles as an npm/jsr publishing tool. beyond bundling, dler serves as a comprehensive codemod toolkit for modern typescript/javascript development.
unjs/unbuild
drop-in with different powerful capabilities like publishingpackage.json
maintenance headaches foreverlibs
feature for multi-library projectsdler excels at managing both build and publish workflows, making it ideal for:
full monorepo system with advanced dependency management and cross-package optimization.
legend:
make sure you have git, node.js, and bun/pnpm/yarn/npm (bun is highly recommended) are installed. then:
💡 tip: want to test dler before integrating it into your project? clone the dler repo and build it using dler itself!
1git clone https://github.com/reliverse/dler.git 2cd dler 3bun i 4bun dev # bun src/cli.ts --dev
install as dev dep (recommended):
1bun add -D @reliverse/dler 2# or update as needed: 3bun update --latest
and/or install globally:
1bun add -g @reliverse/dler 2# or update as needed: 3bun i -g update --latest
dler
anywhere.bun dler
, inside your project directory.a. configure .gitignore
:
1echo "dist*" >> .gitignore 2echo "logs" >> .gitignore
b. add ".config/**/*.ts"
to include
in tsconfig.json
:
1"include": [".config/**/*.ts", ...]
c. package.json:
1"scripts": { 2 "build": "dler build", // this is optional 3 "pub": "dler pub" // this does build+publish 4}
d. initialize config:
1bun dler # if installed as dev dep 2dler # if installed globally
.config/dler.ts
file is automatically created on first run.e. optionally, customize .config/dler.ts
:
.ts
and .js
, you can customize buildPreExtensions
array (example: ["ts", "js", "vue", "tsx", "jsx"]
).buildTemplatesDir
string (example: "templates"
). by placing them in this directory, they will not be built, whole directory will be copied from e.g. src/foo/templates
to dist-*/bin/foo/templates
as-is.1bun dler [build|pub|--help] # if installed as dev dep 2dler [build|pub|--help] # if installed globally
(run just dler
to see an interactive list of commands)
dler ships with a flexible command system (prev. plugins) and 16 built-in commands (from reliverse addons collection).
feel free to create your own commands. commands can be implemented as built-in directly in src/app/<command>/impl/*
and then imported from src/app/<command>/cmd.ts
; or implemented in your own library and then imported from src/app/<command>/cmd.ts
.
if you run just dler
— it will display a list of commands which you can launch interactively.
build — pub — agg — check — conv — copy — init — inject — libs — merge — migrate — rempts — rename — spell — split — pack
build
since dler is fully modular, build command is separated for its own build-in plugin as well.
1bun dler build ...
pub
pub command is separated for its own build-in plugin as well.
it already calls build command by itself, so you don't need to run dler build
separately.
1bun dler pub ...
agg
generates aggregator file with content like import { getsomething } from "./utils.js"
.
1# interactively: 2dler > "agg" 3# non-interactively: 4dler agg --input <dir> --out <file> [options]
usage example: if you're exploring the example playground, you can try the following:
ctrl+a
, then backspace
. run the command below and watch the magic happen:1bun tools:agg # shortcut for: 2bun src/cli.ts tools --dev --tool agg --input src/libs/sdk/sdk-impl --out src/libs/sdk/sdk-mod.ts --recursive --named --strip src/libs/sdk
check
checks your project for common issues and potential improvements. This command performs several types of checks (aka rules of dler):
File Extensions: Validates that files have the correct extensions based on their location and module resolution strategy
.ts
files in source and JSR distributions.js
files in NPM distributions.css
and .json
files in all environmentsPath Extensions: Ensures import statements use the correct file extensions
Dependencies: Identifies missing dependencies in your project
Self-Include: Prevents circular dependencies and self-imports
Module Resolution: Validates TypeScript module resolution settings
Dler Config Health: Validates your dler configuration
Package.json Validation: Ensures your package.json follows best practices
1# Fully interactive mode (when no args provided) 2dler check 3 4# Mixed mode (some args provided, prompts for the rest) 5dler check --directory src 6dler check --checks file-extensions,path-extensions 7dler check --strict 8 9# Fully automated mode (all args provided) 10dler check --directory src --checks file-extensions,path-extensions --strict 11 12# Output in JSON format 13dler check --json
arguments:
--directory
: directory to check (src, dist-npm, dist-jsr, dist-libs/npm, dist-libs/jsr, or all)--checks
: comma-separated list of checks to run (missing-deps, file-extensions, path-extensions, dler-config-health, self-include, tsconfig-health, package-json-health)--strict
: enable strict mode (requires explicit extensions)--json
: output results in JSON formatpro tip:
the command will prompt you only for the arguments you haven't provided. for example, if you specify --directory
but not --checks
, it will only prompt you to select which checks to run.
how deps check works:
finds missing dependencies in your project by scanning your code for imports and comparing them to your package.json
. This command is particularly useful for maintaining clean dependency lists and preventing runtime errors.
what it does:
.js
, .jsx
, .ts
, and .tsx
files in your project (by default, in the current directory)@org/dep-name
)import ... from "dep"
) and commonjs (require("dep")
)dep/some/file
to just dep
./foo
, ../bar
)node_modules
, .git
, and common build folderspackage.json
devDependencies
but used in production codedependencies
and devDependencies
usage examples:
1# basic usage - scan current directory 2dler deps 3 4# scan a specific directory 5dler deps --directory ./my-project 6 7# show all dependencies (both listed and missing) 8dler deps --all 9 10# ignore specific patterns 11dler deps --ignore "test/**,example/**" 12 13# output in json format 14dler deps --json 15 16# include node.js built-in modules 17dler deps --include-builtins 18 19# combine options 20dler deps --all --directory ./src --include-builtins
missing dependencies are shown only once, even if used in multiple files.
deep imports like dep/some/file
or @org/dep/some/thing
are always resolved to their root package.
warning types:
package.json
devDependencies
but imported in production codedependencies
and devDependencies
conv
not yet documented.
copy
1# simple example: 2bun dler copy --s "src/**/*.ts" --d "dist" 3 4# advanced example: 5bun dler copy --s ".temp/packages/*/lib/**/*" --d "src/libs/sdk/sdk-impl/rules/external"
init
not yet documented.
inject
not yet documented.
libs
builds and publishes specific subdirectories of your main project as standalone packages.
usage example:
using dler
to package src/libs/sdk:
1// .config/dler.ts 2libsactmode: "main-and-libs", 3libsdirdist: "dist-libs", 4libsdirsrc: "src/libs", 5libslist: { 6 "@reliverse/dler-sdk": { 7 libdeclarations: true, 8 libdescription: "@reliverse/dler without cli", 9 libdirname: "sdk", 10 libmainfile: "sdk-mod.ts", 11 libpkgkeepdeps: false, 12 libtranspileminify: true, 13 }, 14},
dler task commands:
// dler-replace-line
tells dler to grab the contents of ../../types.ts
and inject them directly in place of your command definition.
1export * from "../../types"; // dler-replace-line 2// or: 3export type { specificTypeName1, specificTypeName2 } from "../../types"; // dler-replace-line
more magic commands coming soon...
merge
merges multiple files into a single file. The command is built for both CI and interactive use, with support for glob patterns and advanced options.
key features:
@reliverse/rempts
@reliverse/relinka
usage examples:
1# simple example: 2bun dler merge --s "src/**/*.ts" --d "dist/merged.ts" 3 4# advanced example: 5bun dler merge --s ".temp1/packages/*/lib/**/*" --d ".temp2/merged.ts" --sort "mtime" --header "// Header" --footer "// Footer" --dedupe
arguments:
--s
: Input glob patterns (array)--d
: Output file path or directory--ignore
: Extra ignore patterns (array)--format
: Fallback extension when output path is omitted (default: "txt")--stdout
: Print to stdout--noPath
: Don't inject relative path below each file--pathAbove
: Print file path above each file's content (default: true)--separator
: Custom separator (default: "\n\n")--comment
: Custom comment prefix (e.g. '# ')--forceComment
: Force custom comment prefix for all file types--batch
: Disable interactive prompts (CI/non-interactive mode)--recursive
: Recursively process all files in subdirectories (default: true)--preserveStructure
: Preserve source directory structure in output (default: true)--increment
: Attach an incrementing index to each output filename--concurrency
: Number of concurrent file operations (default: 8)--sort
: Sort files by: name, path, mtime, none (default: path)--dryRun
: Show what would be done, but don't write files--backup
: Backup output files before overwriting--dedupe
: Remove duplicate file contents in merge--header
: Header text to add at the start of merged output--footer
: Footer text to add at the end of merged output--select-files
: Prompt for file selection before merging--interactive
: Enable interactive mode with prompts--depth
: Depth level to start processing from (default: 0)--sourcemap
: Generate source map for the merged outputimplementation details:
magic-string
for efficient string manipulation and source map generation@reliverse/reglob
for glob pattern matchingp-map
@reliverse/rempts
@reliverse/relinka
migrate
helps migrate between different libraries and module resolution strategies. currently supports:
anything-bun
: migrate Node.js projects to Bun runtimepath-pathkit
: migrate from node:path and unjs/pathe to pathkit libraryfs-relifso
: migrate from node:fs and fs-extra to relifso librarynodenext-bundler
: migrate between module resolution strategiesreaddir-glob
: migrate from fs.readdir to globby for better file system operationspath-pathkit features:
pathe
and node:path
to @reliverse/pathkit
fs-relifso features:
node:fs
and fs-extra
to @reliverse/relifso
anything-bun features:
node:
prefixpg
/postgres
→ Bun.sql
, sqlite3
→ bun:sqlite
redis
/ioredis
→ Bun.redis
glob
→ Bun.Glob
, bcrypt
/argon2
→ Bun.password
jest
/vitest
→ bun:test
node-ffi
→ bun:ffi
Bun.file
APIBun.serve
readdir-glob features:
fs.readdir
and fs.readdirSync
to globby
fs.promises.readdir
migrationusage examples:
1# Preview changes without applying them 2dler migrate --lib readdir-glob --dryRun 3 4# Apply changes 5dler migrate --lib readdir-glob 6 7# Migrate specific project 8dler migrate --lib readdir-glob --project ./my-app
module resolution targets:
nodenext
: adds .js
extensions to imports and updates tsconfigbundler
: removes extensions from imports and updates tsconfigusage examples:
1# Migrate from node:path and/or pathe to pathkit 2dler migrate --lib path-pathkit 3 4# Migrate from node:fs and/or fs-extra to relifso 5dler migrate --lib fs-relifso 6 7# Migrate to nodenext module resolution 8dler migrate --lib nodenext-bundler --target nodenext 9 10# Migrate to bundler module resolution 11dler migrate --lib nodenext-bundler --target bundler 12 13# Preview changes without applying them 14dler migrate --lib nodenext-bundler --target nodenext --dryRun
what it does:
console-relinka
:
@reliverse/relinka's best friend. Converts between different logging formats (console, consola method/object, and relinka's function/method/object styles).
1# Basic usage 2dler relinka --input <file> --from <source> --to <target> 3 4# Examples: 5# Convert console.log to relinka function style 6dler relinka --input src/app.ts --from console --to relinkaFunction 7 8# Convert consola method to relinka method style 9dler relinka --input src/app.ts --from consolaMethod --to relinkaMethod 10 11# Convert between relinka styles 12dler relinka --input src/app.ts --from relinkaMethod --to relinkaObject 13 14# Convert to consola object style 15dler relinka --input src/app.ts --from relinkaFunction --to consolaObject
Supported formats:
console
: Standard console logging (console.log(message, ...args)
)consolaMethod
: Consola method style (consola.log(message, ...args)
)consolaObject
: Consola object style (consola({ level, message, title?, args? })
)relinkaFunction
: Relinka function style (relinka("level", message, ...args)
)relinkaMethod
: Relinka method style (relinka.level(message, ...args)
)relinkaObject
: Relinka object style (relinka({ level, message, title?, args? })
)Special features:
next steps after migration:
for path-pathkit:
for fs-relifso:
for nodenext-bundler:
for anything-bun:
for readdir-glob:
rempts
@reliverse/rempts's best friend. learn more in its docs.
1bun dler rempts 2bun dler rempts --init cmd1 cmd2
rename
1bun dler rename ...
magic
programmatic usage:
1function main() { 2 // may be useful when your cli is a project bootstrapper tool like @reliverse/rse 3 // so you can apply spells to each bootstrapped by you cli project's file 4 await applyMagicSpells(["my-target-dir"]); 5} 6await main();
or, call it from dler config's hook:
1{ 2 hooksAfterBuild: [ 3 async () => { 4 // useful when you want to apply spells right after dler's build 5 await applyMagicSpells(["dist-jsr", "dist-npm", "dist-libs"]); 6 } 7 ], 8}
or, use dler magic
:
1dler magic --targets "my-target-dir"
available spell types:
replace-line
— injects contents from one file into anotherreplace-range
— replaces a range of lines with content from another filerename-file
— renames the current fileremove-comment
— removes a specific comment from coderemove-line
— removes a specific line from coderemove-file
— deletes the current filetransform-content
— applies a transformation to the file contenttransform-line
— applies a transformation to a specific linecopy-file
— copies the current file to a new locationmove-file
— moves the current file to a new locationinsert-at
— inserts content at a specific position in the fileinsert-before
— inserts content before a specific lineinsert-after
— inserts content after a specific lineconditional-execute
— executes spells conditionallyparams:
params are optional and comma-separated.
hooked
(boolean, default: true
)
true
: disables default behavior, so you can trigger the spell yourself (e.g. from your own cli function)false
: dler handles the spell automatically at postbuildstartLine
(number) — line number to start the operation (for range operations)endLine
(number) — line number to end the operation (for range operations)condition
(string) — condition to check before executing the spellskipIfMissing
(boolean) — whether to skip the spell if the target file doesn't existcreateDir
(boolean) — whether to create the target directory if it doesn't existusage examples:
export * from "../../types"; // dler-replace-line
— injects file contents at this line (hooked=true by default)// @ts-expect-error dler-remove-comment
— removes just this comment (hooked=true by default)// dler-remove-line
— removes this line (hooked=true by default)// dler-remove-file
— deletes this file (hooked=true by default)// dler-rename-file-"tsconfig.json"-{hooked=false}
— renames this file (runs at postbuild because hooked=false
)// dler-replace-range-"../../types.js"-{startLine=1,endLine=5}
— replaces lines 1-5 with content from types.js// dler-transform-line-"return line.toUpperCase()"
— transforms the line to uppercase// dler-insert-before-"import { x } from 'y';"
— inserts import statement before this line// dler-insert-after-"export { x };"
— inserts export statement after this line// dler-conditional-execute-{condition="content.includes('TODO')"}
— executes spells only if file contains TODOusing hooked=false
:
// dler-rename-file-"tsconfig.json"-{hooked=false}
— renames the file immediately at postbuild (not hooked)triggering spells:
from dler's cli:
dler spell --trigger rename-file,... --files tsconfig.json,...
dler spell --trigger all
dler spell
from your own code:
1await dler.spell({ spells: ["rename-file"], files: [] }); 2await dler.spell({}) // all spells, all files 3spells: ["all"] // means all spells 4spells: [] // also means all spells 5files: [] // means all files
p.s. see how rse cli uses hooked=true
Contributors: Please check the docs/cmds/SPELLS.md file for more technical details.
split
splits your code/text file into multiple files.
1bun dler split ...
pack
packs a directory of templates into TypeScript modules. This command is useful for creating reusable template packages that can be distributed and used by other projects.
key features:
usage examples:
1# Basic usage 2dler pack --dir ./templates --output ./dist-templates 3 4# With custom whitelabel 5dler pack --dir ./templates --output ./dist-templates --whitelabel MYAPP 6 7# Update specific files only 8dler pack --dir ./templates --output ./dist-templates --files "src/index.ts,src/config.ts" 9 10# Force overwrite existing files 11dler pack --dir ./templates --output ./dist-templates --force 12 13# Update mode (default: true) 14dler pack --dir ./templates --output ./dist-templates --update
arguments:
--dir
: Directory containing templates to process (required)--output
: Output directory for generated modules (default: "my-templates")--whitelabel
: Custom prefix to use instead of 'DLER' (default: "DLER")--cdn
: Remote CDN for binary assets upload (not yet implemented)--force
: Force overwrite existing files (default: false)--update
: Update existing templates and add new ones (default: true)--files
: Comma-separated list of specific files to update--lastUpdate
: Override lastUpdate timestampoutput structure:
1output/ 2├── impl/ 3│ ├── binaries/ # binary files stored with hash-based names (dler reads/writes this dir when --cdn is not used) 4│ │ └── [hashed-files] 5│ ├── template1.ts 6│ └── template2.ts 7├── types.ts 8└── mod.ts
--unpack:
creates file structure from packed templates. This command is the counterpart to pack
and is used to extract and restore template files from a packed template package.
key features:
usage examples:
1# Basic usage 2dler pack ./dist-templates --output ./my-project --unpack 3 4# With custom output directory 5dler pack ./dist-templates --output ./custom-location --unpack 6 7# Preview changes without applying 8dler pack ./dist-templates --output ./my-project --dry-run --unpack 9 10# Clean up existing template files before unpacking 11dler pack ./dist-templates --output ./my-project --cleanup --unpack
arguments:
templatesDir
: Directory containing mod.ts (required)--output
: Where to write files (default: "unpacked")--cdn
: Remote CDN base for binary assets download (not yet implemented)--cleanup
: Clean up template files before unpacking (default: false)--dry-run
: Preview changes without applying them (default: false)implementation details:
jiti
for dynamic template file loadingthe sdk lets you build custom dler cli plugins or even extend your own cli tools.
1bun add @reliverse/dler-sdk
usage example: @reliverse/rse leverages this sdk to extend its functionality.
special thanks to the project that inspired @reliverse/dler
:
libs:pack
: Creates two templates, cfg
and sdk
, based on dist-libs directory structure (using dler pack command).libs:unpack
: Creates a project structure using all templates from the cfg
and sdk
templates (using dler unpack command).libs:example
: Since libs:unpack
's serves as a dist-libs mock, then libs:example
helps easily test dler's features like resolveAllCrossLibs()
.<src | dist-npm | dist-jsr>/libs/<lib-name>/<files live here>
=== dist-libs/<lib-name>/<jsr | npm>/bin/<files live here>
dist-*
-> dist/dist-*
regular
build and publishlibrary
build and publishunbuild
build.config.ts
.config/rse.{ts,jsonc}
🤔dler remdn
(@reliverse/remdn) to generate npm/jsr specific readme and a single docs
dir for a whole project (only readmes will be published, docs are only stored in project's source cpde and can be deployed to user's website)defineconfig
(hooksBeforeBuild
and hooksAfterBuild
are now available, plugin's options can be passed directly to plugin's params, e.g. hooksBeforeBuild: [ async () => { await myCoolPlugin({ /* plugin's options */ }); } ],
)mkdist
can be called using bun
, but bun's own bundler is not yet fully supported🩷 mit © 2025 blefnk nazar kornienko
No vulnerabilities found.
No security vulnerabilities found.