@reliverse/dler 1.7.9 → 1.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +216 -10
  2. package/bin/app/build/cmd.js +11 -2
  3. package/bin/app/build/impl.d.ts +3 -2
  4. package/bin/app/build/impl.js +50 -34
  5. package/bin/app/merge/cmd.d.ts +32 -0
  6. package/bin/app/merge/cmd.js +563 -246
  7. package/bin/app/mkdist/cmd.d.ts +0 -4
  8. package/bin/app/mkdist/cmd.js +0 -4
  9. package/bin/app/mock/cmd.d.ts +41 -0
  10. package/bin/app/mock/cmd.js +284 -0
  11. package/bin/app/mock/mock.d.ts +11 -0
  12. package/bin/app/mock/mock.js +97 -0
  13. package/bin/app/pub/cmd.js +10 -1
  14. package/bin/libs/sdk/sdk-impl/build/build-library.js +9 -2
  15. package/bin/libs/sdk/sdk-impl/build/build-regular.js +25 -12
  16. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.d.ts +4 -1
  17. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.js +6 -7
  18. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/sass.js +1 -1
  19. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.js +1 -1
  20. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/dts.js +1 -1
  21. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/vue-dts.js +1 -1
  22. package/bin/libs/sdk/sdk-impl/cfg/info.js +1 -1
  23. package/bin/libs/sdk/sdk-impl/spell/spell-parser.d.ts +1 -1
  24. package/bin/libs/sdk/sdk-impl/spell/spell-parser.js +2 -2
  25. package/bin/libs/sdk/sdk-impl/spell/spell-types.d.ts +27 -1
  26. package/bin/libs/sdk/sdk-impl/utils/b-exts.d.ts +5 -0
  27. package/bin/libs/sdk/sdk-impl/utils/b-exts.js +406 -0
  28. package/bin/libs/sdk/sdk-impl/utils/binary.d.ts +4 -0
  29. package/bin/libs/sdk/sdk-impl/utils/binary.js +11 -0
  30. package/bin/libs/sdk/sdk-impl/utils/file-type.d.ts +21 -0
  31. package/bin/libs/sdk/sdk-impl/utils/file-type.js +78 -0
  32. package/bin/libs/sdk/sdk-impl/utils/utils-clean.js +0 -1
  33. package/bin/libs/sdk/sdk-impl/utils/utils-fs.d.ts +28 -6
  34. package/bin/libs/sdk/sdk-impl/utils/utils-fs.js +73 -124
  35. package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.js +20 -2
  36. package/bin/libs/sdk/sdk-impl/utils/utils-security.d.ts +15 -0
  37. package/bin/libs/sdk/sdk-impl/utils/utils-security.js +102 -0
  38. package/bin/libs/sdk/sdk-mod.d.ts +3 -3
  39. package/bin/libs/sdk/sdk-mod.js +3 -2
  40. package/bin/libs/sdk/sdk-types.d.ts +15 -4
  41. package/package.json +2 -2
  42. package/bin/app/conv/README.md +0 -3
  43. package/bin/app/merge/README.md +0 -125
  44. package/bin/app/split/README.md +0 -13
  45. /package/bin/libs/sdk/sdk-impl/utils/{tools/tools-agg.d.ts → tools-agg.d.ts} +0 -0
  46. /package/bin/libs/sdk/sdk-impl/utils/{tools/tools-agg.js → tools-agg.js} +0 -0
  47. /package/bin/libs/sdk/sdk-impl/utils/{tools/tools-impl.d.ts → tools-impl.d.ts} +0 -0
  48. /package/bin/libs/sdk/sdk-impl/utils/{tools/tools-impl.js → tools-impl.js} +0 -0
@@ -8,7 +8,6 @@ import Module from "node:module";
8
8
  import prettyBytes from "pretty-bytes";
9
9
  import prettyMilliseconds from "pretty-ms";
10
10
  import { glob } from "tinyglobby";
11
- import { copyInsteadOfBuild } from "../../../utils/utils-fs.js";
12
11
  import { createPerfTimer, getElapsedPerfTime } from "../../../utils/utils-perf.js";
13
12
  import { copyBuild } from "./copy/copy-mod.js";
14
13
  import { mkdistBuild } from "./mkdist/mkdist-mod.js";
@@ -30,11 +29,14 @@ function shouldStopAtStep(stepNumber) {
30
29
  process.exit(0);
31
30
  }
32
31
  }
33
- export async function unifiedBuild(inputSourceDir, isCLI, isLib, rootDir, inputConfig, outDir, transpileStub = false) {
32
+ export async function unifiedBuild(inputSourceDir, coreIsCLI, isLib, rootDir, inputConfig, outDir, transpileStub = false) {
34
33
  shouldStopAtStep(1);
35
34
  relinka("info", "Starting unified build process...");
36
35
  relinka("verbose", `Processing build for source directory: ${inputSourceDir}`);
37
- relinka("verbose", `Output directory: ${outDir}, Is CLI: ${isCLI}, Is Library: ${isLib}`);
36
+ relinka(
37
+ "verbose",
38
+ `Output directory: ${outDir}, Is CLI: ${coreIsCLI.enabled}, Is Library: ${isLib}`
39
+ );
38
40
  const resolvedRootDir = resolve(process.cwd(), rootDir || ".");
39
41
  const jiti = createJiti(resolvedRootDir);
40
42
  const _buildConfig = await jiti.import(inputConfig?.config || ".config/dler.ts", {
@@ -68,9 +70,6 @@ export async function unifiedBuild(inputSourceDir, isCLI, isLib, rootDir, inputC
68
70
  isLib
69
71
  );
70
72
  }
71
- if (isCLI && inputConfig.dontBuildCopyInstead?.length) {
72
- await copyInsteadOfBuild(inputSourceDir, outDir, inputConfig.dontBuildCopyInstead);
73
- }
74
73
  }
75
74
  async function _build(rootDir, inputConfig, buildConfig, pkg, cleanedDirs, _transpileStubMode, _transpileWatchMode, outDir, showOutLog, isLib) {
76
75
  const timer = createPerfTimer();
@@ -154,7 +153,7 @@ async function _build(rootDir, inputConfig, buildConfig, pkg, cleanedDirs, _tran
154
153
  isLib
155
154
  });
156
155
  shouldStopAtStep(5);
157
- relinka("info", "Configuration merged with defaults");
156
+ relinka("log", "Build-specific configuration merged with defaults");
158
157
  relinka("verbose", `Build options: clean=${options.clean}, parallel=${options.parallel}`);
159
158
  relinka("verbose", `Declaration files: ${options.declaration ? "enabled" : "disabled"}`);
160
159
  options.outDir = resolve(options.rootDir, options.outDir);
@@ -1,5 +1,5 @@
1
+ import { basename } from "@reliverse/pathkit";
1
2
  import { pathToFileURL } from "node:url";
2
- import { basename } from "pathe";
3
3
  export const sassLoader = async (input) => {
4
4
  if (![".sass", ".scss"].includes(input.extension)) {
5
5
  return;
@@ -1,6 +1,6 @@
1
+ import { resolve, extname, join, basename, dirname } from "@reliverse/pathkit";
1
2
  import defu from "defu";
2
3
  import fsp from "node:fs/promises";
3
- import { resolve, extname, join, basename, dirname } from "pathe";
4
4
  import { glob } from "tinyglobby";
5
5
  import { createLoader } from "./loader.js";
6
6
  import { getDeclarations, normalizeCompilerOptions } from "./utils/dts.js";
@@ -1,6 +1,6 @@
1
+ import { resolve } from "@reliverse/pathkit";
1
2
  import { findStaticImports, findDynamicImports, findExports, findTypeExports } from "mlly";
2
3
  import { statSync } from "node:fs";
3
- import { resolve } from "pathe";
4
4
  export async function normalizeCompilerOptions(_options) {
5
5
  const ts = await import("typescript").then((r) => r.default || r);
6
6
  return ts.convertCompilerOptionsFromJson(_options, process.cwd()).options;
@@ -1,5 +1,5 @@
1
+ import { normalize } from "@reliverse/pathkit";
1
2
  import { createRequire } from "node:module";
2
- import { normalize } from "pathe";
3
3
  import { satisfies } from "semver";
4
4
  import { augmentWithDiagnostics, extractDeclarations } from "./dts.js";
5
5
  const require = createRequire(import.meta.url);
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.9";
2
+ const version = "1.7.11";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -1,4 +1,4 @@
1
- import type { Spell, SpellParams } from "./spell-types";
1
+ import type { Spell, SpellParams } from "./spell-types.js";
2
2
  export declare const parseParams: (paramsStr: string | undefined) => SpellParams;
3
3
  export declare const parseSpellFromComment: (line: string, lineNumber: number, fileName: string) => Spell | null;
4
4
  export declare const extractSpellsFromFile: (filePath: string, content: string) => Promise<Spell[]>;
@@ -1,7 +1,7 @@
1
- const SPELL_REGEX = /<dler-([a-z-]+)-(?:"([^"]+)")?-?(?:{([^}]+)})?>/;
1
+ const SPELL_REGEX = /dler-([a-z-]+)-(?:"([^"]+)")?-?(?:{([^}]+)})?/;
2
2
  export const parseParams = (paramsStr) => {
3
3
  const defaultParams = {
4
- hooked: false
4
+ hooked: true
5
5
  };
6
6
  if (!paramsStr) return defaultParams;
7
7
  const params = { ...defaultParams };
@@ -1,6 +1,18 @@
1
- export type SpellType = "replace-line" | "rename-file" | "remove-comment" | "remove-line" | "remove-file" | "transform-content" | "copy-file" | "move-file" | "insert-at";
1
+ export type SpellType = "replace-line" | "replace-range" | "rename-file" | "remove-comment" | "remove-line" | "remove-file" | "transform-content" | "transform-line" | "copy-file" | "move-file" | "insert-at" | "insert-before" | "insert-after" | "conditional-execute";
2
2
  export type SpellParams = {
3
+ /** Whether the spell should be executed manually (true) or automatically at postbuild (false) */
3
4
  hooked: boolean;
5
+ /** Line number to start the operation (for range operations) */
6
+ startLine?: number;
7
+ /** Line number to end the operation (for range operations) */
8
+ endLine?: number;
9
+ /** Condition to check before executing the spell */
10
+ condition?: string;
11
+ /** Whether to skip the spell if the target file doesn't exist */
12
+ skipIfMissing?: boolean;
13
+ /** Whether to create the target directory if it doesn't exist */
14
+ createDir?: boolean;
15
+ /** Custom parameters for specific spell types */
4
16
  [key: string]: any;
5
17
  };
6
18
  export type Spell = {
@@ -10,17 +22,25 @@ export type Spell = {
10
22
  lineNumber?: number;
11
23
  fullMatch?: string;
12
24
  fileName?: string;
25
+ /** Optional array of spells that must be executed before this one */
26
+ dependsOn?: Spell[];
13
27
  };
14
28
  export type SpellExecutionOptions = {
15
29
  spells?: (SpellType | "all")[];
16
30
  files?: string[];
17
31
  dryRun?: boolean;
32
+ /** Whether to show detailed changes in the output */
33
+ showChanges?: boolean;
34
+ /** Whether to validate spell parameters before execution */
35
+ validate?: boolean;
18
36
  };
19
37
  export type FileOperation = {
20
38
  type: "read" | "write" | "rename" | "remove" | "copy" | "move";
21
39
  sourcePath: string;
22
40
  targetPath?: string;
23
41
  content?: string;
42
+ /** Whether to create parent directories if they don't exist */
43
+ createDir?: boolean;
24
44
  };
25
45
  export type SpellResult = {
26
46
  spell: Spell;
@@ -31,4 +51,10 @@ export type SpellResult = {
31
51
  before: string;
32
52
  after: string;
33
53
  };
54
+ /** Detailed information about the changes made */
55
+ details?: {
56
+ linesAffected?: number[];
57
+ filesAffected?: string[];
58
+ validationErrors?: string[];
59
+ };
34
60
  };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * List of known binary file extensions
3
+ */
4
+ export declare const BINARY_EXTS: readonly ["386", "3ds", "3g2", "3gp", "3mf", "7z", "aac", "ac3", "ace", "ai", "aif", "aiff", "alias", "alz", "amr", "ape", "apk", "apks", "apng", "app", "ar", "arj", "arrow", "arw", "asar", "asf", "au", "avi", "avif", "avro", "ax", "bak", "baml", "bh", "bin", "bk", "blend", "blp", "bmp", "bmsh", "bpg", "bsp", "btif", "bz2", "bzip2", "cab", "caf", "cfb", "cgm", "chm", "class", "cmx", "cpio", "cpl", "cr2", "cr3", "crx", "cur", "dat", "db", "dcm", "dds", "deb", "dex", "dff", "dib", "djvu", "dll", "dmg", "dng", "doc", "docm", "docx", "dot", "dotm", "dotx", "dra", "drc", "drv", "DS_Store", "dsf", "dsk", "dts", "dtshd", "dvb", "dwg", "dxf", "ecelp4800", "ecelp7470", "ecelp9600", "egg", "ehthumbs.db", "elf", "eot", "eps", "epub", "exe", "exp", "f4a", "f4b", "f4p", "f4v", "fbs", "fbx", "fh", "fig", "fla", "flac", "fli", "flif", "flv", "fpx", "fst", "fvt", "g3", "gif", "glb", "graffle", "gz", "gzip", "h261", "h263", "h264", "h5", "hdf5", "heic", "heif", "icc", "icns", "ico", "ics", "idx", "ief", "iff", "ilk", "img", "ind", "indd", "ipa", "iso", "it", "j2c", "jar", "jfif", "jls", "jng", "jp2", "jpeg", "jpg", "jpm", "jps", "jpx", "jxl", "jxr", "key", "kra", "ktx", "lbm", "ldb", "ldf", "lha", "lib", "lnk", "lockb", "lvp", "lz", "lz4", "lzh", "lzma", "lzo", "m3u", "m4a", "m4b", "m4p", "m4v", "macho", "mar", "max", "mb", "mbw", "md2", "md3", "md5", "mdb", "mdf", "mdi", "mdl", "mesh", "mht", "mid", "midi", "mie", "mj2", "mka", "mkv", "mlv", "mmr", "mng", "mobi", "mov", "movie", "mp1", "mp2", "mp3", "mp4", "mp4a", "mpc", "mpeg", "mpg", "mpga", "msi", "msp", "mts", "mxf", "mxu", "ndf", "nef", "nes", "npx", "numbers", "o", "oar", "obj", "ocx", "odg", "odp", "ods", "odt", "oga", "ogg", "ogm", "ogv", "ogx", "opus", "orc", "orf", "otb", "otf", "otg", "otp", "ots", "ott", "pages", "pak", "parquet", "pbm", "pcap", "pcx", "pdb", "pdf", "pea", "pgm", "pgp", "pic", "pkg", "png", "pnm", "pns", "pot", "potm", "potx", "ppa", "ppam", "ppm", "pps", "ppsm", "ppsx", "ppt", "pptm", "pptx", "ps", "psd", "pst", "pya", "pyc", "pyo", "pyv", "qcp", "qt", "raf", "rar", "ras", "raw", "rc", "res", "resources", "rgb", "rip", "rlc", "rm", "rmf", "rmvb", "rpm", "rtf", "rw2", "rz", "s3m", "s7z", "scpt", "sgi", "shar", "shp", "sil", "sketch", "skp", "slk", "smv", "so", "spx", "sqlite", "stl", "sub", "sublime-project", "sublime-workspace", "suo", "svg", "swf", "swn", "swo", "swp", "sys", "tar", "tbz", "tbz2", "temp", "tga", "tgz", "thmx", "Thumbs.db", "tif", "tiff", "tlb", "tlz", "tmp", "tox", "ttc", "ttf", "txz", "udf", "unity", "unitypackage", "user", "userosscache", "userprefs", "uvh", "uvi", "uvm", "uvp", "uvs", "uvu", "vcf", "viv", "vob", "voc", "vsdx", "vspscc", "vssscc", "vtt", "vxd", "war", "wasm", "wav", "wax", "wbmp", "wdp", "weba", "webm", "webp", "whl", "wim", "wm", "wma", "wmv", "wmx", "woff", "woff2", "wv", "wvx", "xapk", "xbm", "xcf", "xif", "xla", "xlam", "xls", "xlsb", "xlsm", "xlsx", "xlt", "xltm", "xltx", "xm", "xmind", "xml", "xpi", "xpm", "xwd", "xz", "z", "zip", "zipx", "zoo", "zst"];
5
+ export declare const BINARY_SET: Set<string>;
@@ -0,0 +1,406 @@
1
+ export const BINARY_EXTS = [
2
+ "386",
3
+ "3ds",
4
+ "3g2",
5
+ "3gp",
6
+ "3mf",
7
+ "7z",
8
+ "aac",
9
+ "ac3",
10
+ "ace",
11
+ "ai",
12
+ "aif",
13
+ "aiff",
14
+ "alias",
15
+ "alz",
16
+ "amr",
17
+ "ape",
18
+ "apk",
19
+ "apks",
20
+ "apng",
21
+ "app",
22
+ "ar",
23
+ "arj",
24
+ "arrow",
25
+ "arw",
26
+ "asar",
27
+ "asf",
28
+ "au",
29
+ "avi",
30
+ "avif",
31
+ "avro",
32
+ "ax",
33
+ "bak",
34
+ "baml",
35
+ "bh",
36
+ "bin",
37
+ "bk",
38
+ "blend",
39
+ "blp",
40
+ "bmp",
41
+ "bmsh",
42
+ "bpg",
43
+ "bsp",
44
+ "btif",
45
+ "bz2",
46
+ "bzip2",
47
+ "cab",
48
+ "caf",
49
+ "cfb",
50
+ "cgm",
51
+ "chm",
52
+ "class",
53
+ "cmx",
54
+ "cpio",
55
+ "cpl",
56
+ "cr2",
57
+ "cr3",
58
+ "crx",
59
+ "cur",
60
+ "dat",
61
+ "db",
62
+ "dcm",
63
+ "dds",
64
+ "deb",
65
+ "dex",
66
+ "dff",
67
+ "dib",
68
+ "djvu",
69
+ "dll",
70
+ "dmg",
71
+ "dng",
72
+ "doc",
73
+ "docm",
74
+ "docx",
75
+ "dot",
76
+ "dotm",
77
+ "dotx",
78
+ "dra",
79
+ "drc",
80
+ "drv",
81
+ "DS_Store",
82
+ "dsf",
83
+ "dsk",
84
+ "dts",
85
+ "dtshd",
86
+ "dvb",
87
+ "dwg",
88
+ "dxf",
89
+ "ecelp4800",
90
+ "ecelp7470",
91
+ "ecelp9600",
92
+ "egg",
93
+ "ehthumbs.db",
94
+ "elf",
95
+ "eot",
96
+ "eps",
97
+ "epub",
98
+ "exe",
99
+ "exp",
100
+ "f4a",
101
+ "f4b",
102
+ "f4p",
103
+ "f4v",
104
+ "fbs",
105
+ "fbx",
106
+ "fh",
107
+ "fig",
108
+ "fla",
109
+ "flac",
110
+ "fli",
111
+ "flif",
112
+ "flv",
113
+ "fpx",
114
+ "fst",
115
+ "fvt",
116
+ "g3",
117
+ "gif",
118
+ "glb",
119
+ "graffle",
120
+ "gz",
121
+ "gzip",
122
+ "h261",
123
+ "h263",
124
+ "h264",
125
+ "h5",
126
+ "hdf5",
127
+ "heic",
128
+ "heif",
129
+ "icc",
130
+ "icns",
131
+ "ico",
132
+ "ics",
133
+ "idx",
134
+ "ief",
135
+ "iff",
136
+ "ilk",
137
+ "img",
138
+ "ind",
139
+ "indd",
140
+ "ipa",
141
+ "iso",
142
+ "it",
143
+ "j2c",
144
+ "jar",
145
+ "jfif",
146
+ "jls",
147
+ "jng",
148
+ "jp2",
149
+ "jpeg",
150
+ "jpg",
151
+ "jpm",
152
+ "jps",
153
+ "jpx",
154
+ "jxl",
155
+ "jxr",
156
+ "key",
157
+ "kra",
158
+ "ktx",
159
+ "lbm",
160
+ "ldb",
161
+ "ldf",
162
+ "lha",
163
+ "lib",
164
+ "lnk",
165
+ "lockb",
166
+ "lvp",
167
+ "lz",
168
+ "lz4",
169
+ "lzh",
170
+ "lzma",
171
+ "lzo",
172
+ "m3u",
173
+ "m4a",
174
+ "m4b",
175
+ "m4p",
176
+ "m4v",
177
+ "macho",
178
+ "mar",
179
+ "max",
180
+ "mb",
181
+ "mbw",
182
+ "md2",
183
+ "md3",
184
+ "md5",
185
+ "mdb",
186
+ "mdf",
187
+ "mdi",
188
+ "mdl",
189
+ "mesh",
190
+ "mht",
191
+ "mid",
192
+ "midi",
193
+ "mie",
194
+ "mj2",
195
+ "mka",
196
+ "mkv",
197
+ "mlv",
198
+ "mmr",
199
+ "mng",
200
+ "mobi",
201
+ "mov",
202
+ "movie",
203
+ "mp1",
204
+ "mp2",
205
+ "mp3",
206
+ "mp4",
207
+ "mp4a",
208
+ "mpc",
209
+ "mpeg",
210
+ "mpg",
211
+ "mpga",
212
+ "msi",
213
+ "msp",
214
+ "mts",
215
+ "mxf",
216
+ "mxu",
217
+ "ndf",
218
+ "nef",
219
+ "nes",
220
+ "npx",
221
+ "numbers",
222
+ "o",
223
+ "oar",
224
+ "obj",
225
+ "ocx",
226
+ "odg",
227
+ "odp",
228
+ "ods",
229
+ "odt",
230
+ "oga",
231
+ "ogg",
232
+ "ogm",
233
+ "ogv",
234
+ "ogx",
235
+ "opus",
236
+ "orc",
237
+ "orf",
238
+ "otb",
239
+ "otf",
240
+ "otg",
241
+ "otp",
242
+ "ots",
243
+ "ott",
244
+ "pages",
245
+ "pak",
246
+ "parquet",
247
+ "pbm",
248
+ "pcap",
249
+ "pcx",
250
+ "pdb",
251
+ "pdf",
252
+ "pea",
253
+ "pgm",
254
+ "pgp",
255
+ "pic",
256
+ "pkg",
257
+ "png",
258
+ "pnm",
259
+ "pns",
260
+ "pot",
261
+ "potm",
262
+ "potx",
263
+ "ppa",
264
+ "ppam",
265
+ "ppm",
266
+ "pps",
267
+ "ppsm",
268
+ "ppsx",
269
+ "ppt",
270
+ "pptm",
271
+ "pptx",
272
+ "ps",
273
+ "psd",
274
+ "pst",
275
+ "pya",
276
+ "pyc",
277
+ "pyo",
278
+ "pyv",
279
+ "qcp",
280
+ "qt",
281
+ "raf",
282
+ "rar",
283
+ "ras",
284
+ "raw",
285
+ "rc",
286
+ "res",
287
+ "resources",
288
+ "rgb",
289
+ "rip",
290
+ "rlc",
291
+ "rm",
292
+ "rmf",
293
+ "rmvb",
294
+ "rpm",
295
+ "rtf",
296
+ "rw2",
297
+ "rz",
298
+ "s3m",
299
+ "s7z",
300
+ "scpt",
301
+ "sgi",
302
+ "shar",
303
+ "shp",
304
+ "sil",
305
+ "sketch",
306
+ "skp",
307
+ "slk",
308
+ "smv",
309
+ "so",
310
+ "spx",
311
+ "sqlite",
312
+ "stl",
313
+ "sub",
314
+ "sublime-project",
315
+ "sublime-workspace",
316
+ "suo",
317
+ "svg",
318
+ "swf",
319
+ "swn",
320
+ "swo",
321
+ "swp",
322
+ "sys",
323
+ "tar",
324
+ "tbz",
325
+ "tbz2",
326
+ "temp",
327
+ "tga",
328
+ "tgz",
329
+ "thmx",
330
+ "Thumbs.db",
331
+ "tif",
332
+ "tiff",
333
+ "tlb",
334
+ "tlz",
335
+ "tmp",
336
+ "tox",
337
+ "ttc",
338
+ "ttf",
339
+ "txz",
340
+ "udf",
341
+ "unity",
342
+ "unitypackage",
343
+ "user",
344
+ "userosscache",
345
+ "userprefs",
346
+ "uvh",
347
+ "uvi",
348
+ "uvm",
349
+ "uvp",
350
+ "uvs",
351
+ "uvu",
352
+ "vcf",
353
+ "viv",
354
+ "vob",
355
+ "voc",
356
+ "vsdx",
357
+ "vspscc",
358
+ "vssscc",
359
+ "vtt",
360
+ "vxd",
361
+ "war",
362
+ "wasm",
363
+ "wav",
364
+ "wax",
365
+ "wbmp",
366
+ "wdp",
367
+ "weba",
368
+ "webm",
369
+ "webp",
370
+ "whl",
371
+ "wim",
372
+ "wm",
373
+ "wma",
374
+ "wmv",
375
+ "wmx",
376
+ "woff",
377
+ "woff2",
378
+ "wv",
379
+ "wvx",
380
+ "xapk",
381
+ "xbm",
382
+ "xcf",
383
+ "xif",
384
+ "xla",
385
+ "xlam",
386
+ "xls",
387
+ "xlsb",
388
+ "xlsm",
389
+ "xlsx",
390
+ "xlt",
391
+ "xltm",
392
+ "xltx",
393
+ "xm",
394
+ "xmind",
395
+ "xml",
396
+ "xpi",
397
+ "xpm",
398
+ "xwd",
399
+ "xz",
400
+ "z",
401
+ "zip",
402
+ "zipx",
403
+ "zoo",
404
+ "zst"
405
+ ];
406
+ export const BINARY_SET = new Set(BINARY_EXTS);
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Check if a file is binary using both file-type library and BINARY_EXTS fallback
3
+ */
4
+ export declare const isBinaryExt: (file: string) => Promise<boolean>;
@@ -0,0 +1,11 @@
1
+ import path from "node:path";
2
+ import { BINARY_SET } from "./b-exts.js";
3
+ import { isBinary } from "./file-type.js";
4
+ export const isBinaryExt = async (file) => {
5
+ try {
6
+ return await isBinary(file);
7
+ } catch {
8
+ const ext = path.extname(file).slice(1).toLowerCase();
9
+ return BINARY_SET.has(ext);
10
+ }
11
+ };
@@ -0,0 +1,21 @@
1
+ import { type FileTypeResult } from "file-type";
2
+ /**
3
+ * Detect file type from a file path
4
+ */
5
+ export declare function detectFileType(filePath: string): Promise<FileTypeResult | undefined>;
6
+ /**
7
+ * Detect file type from a buffer
8
+ */
9
+ export declare function detectBufferType(buffer: Uint8Array | ArrayBuffer): Promise<FileTypeResult | undefined>;
10
+ /**
11
+ * Detect file type from a stream
12
+ */
13
+ export declare function detectStreamType(stream: ReadableStream<Uint8Array>): Promise<FileTypeResult | undefined>;
14
+ /**
15
+ * Check if a file is binary using both file-type and BINARY_EXTS
16
+ */
17
+ export declare function isBinary(filePath: string): Promise<boolean>;
18
+ /**
19
+ * Get MIME type for a file using both file-type and BINARY_EXTS
20
+ */
21
+ export declare function getMimeType(filePath: string): Promise<string | undefined>;